feat: 实现udp多端口

This commit is contained in:
2025-07-14 14:01:08 +08:00
parent 2894ee24be
commit ca906489c2
9 changed files with 53 additions and 92 deletions

View File

@@ -82,7 +82,7 @@ public class I2c
/// <param name="taskID">[TODO:parameter]</param>
/// <param name="timeout">[TODO:parameter]</param>
/// <returns>[TODO:return]</returns>
public I2c(string address, int port, int taskID,int timeout = 2000)
public I2c(string address, int port, int taskID, int timeout = 2000)
{
if (timeout < 0)
throw new ArgumentException("Timeout couldn't be negative", nameof(timeout));
@@ -109,7 +109,7 @@ public class I2c
}
// 清除UDP服务器接收缓冲区
await MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address} receive data");
@@ -207,7 +207,7 @@ public class I2c
}
// 清除UDP服务器接收缓冲区
await MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
MsgBus.UDPServer.ClearUDPData(this.address, this.taskID);
logger.Trace($"Clear up udp server {this.address} receive data");