refactor: 重新调整后端工程结构

This commit is contained in:
2025-07-08 21:21:07 +08:00
parent 23236b22bd
commit dd7efe3c84
7 changed files with 857 additions and 735 deletions

View File

@@ -311,10 +311,10 @@ public class UDPClientPool
/// <param name="endPoint">IP端点IP地址与端口</param>
/// <param name="taskID">任务ID</param>
/// <param name="devAddr">设备地址</param>
/// <param name="dataLength">要读取的数据长度(字节)</param>
/// <param name="dataLength">要读取的数据长度(4字节)</param>
/// <param name="timeout">超时时间(毫秒)</param>
/// <returns>读取结果,包含接收到的字节数组</returns>
public static async ValueTask<Result<byte[]>> ReadAddrBytes(
public static async ValueTask<Result<byte[]>> ReadAddr4Bytes(
IPEndPoint endPoint, int taskID, UInt32 devAddr, int dataLength, int timeout = 1000)
{
var ret = false;
@@ -330,7 +330,7 @@ public class UDPClientPool
return new(new Exception("Message bus not working!"));
// Calculate read times and segments
var max4BytesPerRead = 0x80; // 1024 bytes per read
var max4BytesPerRead = 0x80; // 512 bytes per read
var rest4Bytes = dataLength % max4BytesPerRead;
var readTimes = (rest4Bytes != 0) ?
(dataLength / max4BytesPerRead + 1) :