forked from wenjy/Sln.Iot
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB
C#

#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2025 WenJY
* CLR4.0.30319.42000
* Mr.Wen's MacBook Pro
* Sln.Iot.Business
* AF7CD4B2-87AF-4F91-BECA-13779B05170C
*
* WenJY
*
* 2025-04-11 16:04:07
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
using Sln.Iot.Business.@base;
using Sln.Iot.Common;
using Sln.Iot.Config;
using Sln.Iot.Model.dto;
using Sln.Iot.Serilog;
using Sln.Iot.Socket.Adapter;
using TouchSocket.Core;
using TouchSocket.Sockets;
namespace Sln.Iot.Business
{
/// <summary>
/// 心跳指令
/// </summary>
public class HeartBusiness:BaseBusiness
{
public HeartBusiness(SerilogHelper logger, AppConfig appConfig,StringChange stringChange) : base(logger, appConfig,stringChange)
{
}
public override FilterResult BufferAnalysis(ISocketClient client, BufferRequestInfo requestInfo, int bodyLength)
{
//心跳没有业务逻辑处理
return FilterResult.Success;
}
/// <summary>
/// 应答处理
/// </summary>
/// <param name="client"></param>
/// <param name="buffer"></param>
public override void ResponseHandle(ISocketClient client, byte[] buffer)
{
ResponsePack sendResponsePackInfo = new ResponsePack()
{
m_MessageType = 0xA4
};
base.GetMessagePack(ref sendResponsePackInfo,buffer);
//ByteBlock byteBlock = new ByteBlock(requestInfo.Body);
//byteBlock.Read(out byte[] b_MeterID, 2);
//var MeterID_1 = "00" + Convert.ToInt32(b_MeterID[0]).ToString();
//MeterID_1 = MeterID_1.Substring(MeterID_1.Length - 2, 2);
//var MeterID_2 = "00" + Convert.ToInt32(b_MeterID[1]).ToString();
//MeterID_2 = MeterID_2.Substring(MeterID_2.Length - 2, 2);
//var equipId = requestInfo.ColletEquipCOde + "_" + MeterID_1 + MeterID_2;
//Console.WriteLine($"心跳:::::{}");
base.SendMessageAsync(client, sendResponsePackInfo);
}
}
}