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#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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);
}
}
}