fix: 修改摄像头读取地址

This commit is contained in:
SikongJueluo 2025-07-10 16:24:23 +08:00
parent fad37ba922
commit 558a139593
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,8 @@ class Camera
const UInt16 H_CMOS_DISP = 640; const UInt16 H_CMOS_DISP = 640;
const UInt16 TOTAL_H_PIXEL = 2570; const UInt16 TOTAL_H_PIXEL = 2570;
const UInt16 TOTAL_V_PIXEL = 980; const UInt16 TOTAL_V_PIXEL = 980;
const UInt32 FrameAddr = 0x00;
const UInt32 FrameLength = V_CMOS_DISP * H_CMOS_DISP * 16 / 32; const UInt32 FrameLength = V_CMOS_DISP * H_CMOS_DISP * 16 / 32;
static byte[][] data = new byte[][] { static byte[][] data = new byte[][] {
@ -330,7 +332,7 @@ class Camera
public async ValueTask<Result<bool>> Init() public async ValueTask<Result<bool>> Init()
{ {
{ {
var ret = await UDPClientPool.WriteAddr(this.ep, 2, CameraAddr.STORE_ADDR, 0x00); var ret = await UDPClientPool.WriteAddr(this.ep, 2, CameraAddr.STORE_ADDR, FrameAddr);
if (!ret.IsSuccessful) if (!ret.IsSuccessful)
{ {
logger.Error($"Failed to write STORE_ADDR to camera at {this.address}:{this.port}, error: {ret.Error}"); logger.Error($"Failed to write STORE_ADDR to camera at {this.address}:{this.port}, error: {ret.Error}");
@ -408,7 +410,7 @@ class Camera
var result = await UDPClientPool.ReadAddr4Bytes( var result = await UDPClientPool.ReadAddr4Bytes(
this.ep, this.ep,
2, // taskID 2, // taskID
CameraAddr.BASE, FrameAddr,
((int)FrameLength), ((int)FrameLength),
this.timeout); this.timeout);