diff --git a/server/src/Peripherals/CameraClient.cs b/server/src/Peripherals/CameraClient.cs index e3815a2..b402841 100644 --- a/server/src/Peripherals/CameraClient.cs +++ b/server/src/Peripherals/CameraClient.cs @@ -242,33 +242,6 @@ class Camera return result.Value; } - /// - /// 读取摄像头寄存器 - /// - /// 寄存器地址 - /// 读取到的寄存器值 - private async ValueTask> ReadRegister(UInt16 registerAddr) - { - var i2c = new Peripherals.I2cClient.I2c(this.address, this.port, this.taskID, this.timeout); - - // 地址高低字节 - var addrBytes = new byte[2]; - addrBytes[0] = (byte)(registerAddr >> 8); - addrBytes[1] = (byte)(registerAddr & 0xFF); - - // 先写寄存器地址 - var writeResult = await i2c.WriteData(CAM_I2C_ADDR, addrBytes, CAM_PROTO); - if (!writeResult.IsSuccessful) - return new(writeResult.Error); - - // 再读一个字节 - var readResult = await i2c.ReadData(CAM_I2C_ADDR, 1, CAM_PROTO); - if (!readResult.IsSuccessful) - return new(readResult.Error); - - return readResult.Value[0]; - } - /// /// 批量配置I2C寄存器 ///