diff --git a/server/src/Peripherals/CameraClient.cs b/server/src/Peripherals/CameraClient.cs index 546f4e8..0bea403 100644 --- a/server/src/Peripherals/CameraClient.cs +++ b/server/src/Peripherals/CameraClient.cs @@ -23,8 +23,8 @@ class Camera private IPEndPoint ep; - const uint CAM_I2C_ADDR = 0x78; - const Peripherals.I2cClient.I2cProtocol CAM_PROTO = Peripherals.I2cClient.I2cProtocol.I2c; + const uint CAM_I2C_ADDR = 0x3C; + const Peripherals.I2cClient.I2cProtocol CAM_PROTO = Peripherals.I2cClient.I2cProtocol.SCCB; const UInt16 V_CMOS_DISP = 480; const UInt16 H_CMOS_DISP = 640; const UInt16 TOTAL_H_PIXEL = 2570; @@ -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/UdpClientPool.cs b/server/src/UdpClientPool.cs index bbfeee4..3618134 100644 --- a/server/src/UdpClientPool.cs +++ b/server/src/UdpClientPool.cs @@ -458,11 +458,13 @@ public class UDPClientPool dataArray[(i * (256 * (32 / 8)))..] : dataArray[(i * (256 * (32 / 8)))..((i + 1) * (256 * (32 / 8)))]; + // Calculate BurstLength opts.BurstLength = ((byte)( sendDataArray.Length % 4 == 0 ? - (sendDataArray.Length / 4) : - (sendDataArray.Length / 4) + 1 + (sendDataArray.Length / 4 - 1) : + (sendDataArray.Length / 4) )); + ret = await UDPClientPool.SendAddrPackAsync(endPoint, new SendAddrPackage(opts)); if (!ret) return new(new Exception("Send 1st address package failed!"));