From 8a1d6e52cbf8030ce3a07287adc25a7404626222 Mon Sep 17 00:00:00 2001 From: alivender <13898766233@163.com> Date: Fri, 11 Jul 2025 12:06:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86i2c=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/Peripherals/CameraClient.cs | 2 +- server/src/Peripherals/I2cClient.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/Peripherals/CameraClient.cs b/server/src/Peripherals/CameraClient.cs index 0bea403..78651ab 100644 --- a/server/src/Peripherals/CameraClient.cs +++ b/server/src/Peripherals/CameraClient.cs @@ -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); diff --git a/server/src/Peripherals/I2cClient.cs b/server/src/Peripherals/I2cClient.cs index 893ae8b..4aab247 100644 --- a/server/src/Peripherals/I2cClient.cs +++ b/server/src/Peripherals/I2cClient.cs @@ -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}");