fix: 修复了i2c地址设置问题

This commit is contained in:
alivender 2025-07-11 12:06:44 +08:00
parent 33a2dbf437
commit 8a1d6e52cb
2 changed files with 3 additions and 3 deletions

View File

@ -357,7 +357,7 @@ class Camera
logger.Error($"STORE_NUM write returned false for camera at {this.address}:{this.port}");
return new(new Exception($"STORE_NUM write returned false for camera at {this.address}:{this.port}"));
}
}78
}
{
var ret = await UDPClientPool.WriteAddr(this.ep, 2, CameraAddr.CAPTURE_ON, 0x01);

View File

@ -156,7 +156,7 @@ public class I2c
// 配置I2C地址、协议及启动传输
{
var ret = await UDPClientPool.WriteAddr(
this.ep, 2, I2cAddr.BaseConfig, (devAddr << 1) | (((uint)proto) << 16) | (1 << 24));
this.ep, 2, I2cAddr.BaseConfig, (devAddr) | (((uint)proto) << 16) | (1 << 24));
if (!ret.IsSuccessful)
{
logger.Error($"Failed to configure I2C address/protocol/start: {ret.Error}");
@ -228,7 +228,7 @@ public class I2c
// 配置I2C地址、协议及启动传输读操作
{
var ret = await UDPClientPool.WriteAddr(
this.ep, 2, I2cAddr.BaseConfig, (devAddr << 1) | (1 << 8) | (((uint)proto) << 16) | (1 << 24));
this.ep, 2, I2cAddr.BaseConfig, (devAddr) | (1 << 8) | (((uint)proto) << 16) | (1 << 24));
if (!ret.IsSuccessful)
{
logger.Error($"Failed to configure I2C address/protocol/start: {ret.Error}");