|
|
#region << 版 本 注 释 >>
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
* 版权所有 (c) 2025 WenJY 保留所有权利。
|
|
|
* CLR版本:4.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);
|
|
|
}
|
|
|
}
|
|
|
} |