feat: 完成实验板动态ip与动态mac

This commit is contained in:
2025-07-17 15:49:31 +08:00
parent e4ead72d53
commit f5dd474ba0
4 changed files with 490 additions and 4 deletions

View File

@@ -559,7 +559,6 @@ public class UDPClientPool
IsWrite = true,
};
// Write Register
ret = await UDPClientPool.SendAddrPackAsync(endPoint, new SendAddrPackage(opts));
if (!ret) return new(new Exception("Send 1st address package failed!"));
@@ -602,8 +601,6 @@ public class UDPClientPool
IsWrite = true,
};
// Check Msg Bus
if (!MsgBus.IsRunning)
return new(new Exception("Message bus not working!"));
@@ -644,4 +641,40 @@ public class UDPClientPool
return true;
}
/// <summary>
/// [TODO:description]
/// </summary>
/// <param name="endPoint">[TODO:parameter]</param>
/// <param name="taskID">[TODO:parameter]</param>
/// <param name="addr">[TODO:parameter]</param>
/// <param name="data">[TODO:parameter]</param>
/// <param name="timeout">[TODO:parameter]</param>
/// <returns>[TODO:return]</returns>
public static async ValueTask<Result<bool>> WriteAddrSeq(IPEndPoint endPoint, int taskID, UInt32[] addr, byte[] data, int timeout = 1000)
{
var length = addr.Length;
if (length != data.Length)
{
logger.Error($"TODO");
return new(new ArgumentException($"TODO"));
}
for (int i = 0; i < length; i++)
{
var ret = await WriteAddr(endPoint, taskID, addr[i], (UInt32)data[i], timeout);
if (!ret.IsSuccessful)
{
logger.Error($"TODO");
return new(ret.Error);
}
if (!ret.Value)
{
logger.Error($"TODO");
return false;
}
}
return true;
}
}