This commit is contained in:
zhoujie 2026-03-14 22:00:30 +08:00
parent 30cbf31276
commit 5275511b20
2 changed files with 17 additions and 2 deletions

View File

@ -268,6 +268,21 @@ static void parse_and_dispatch_tlv(TcpStreamCtx_t *ctx, const uint8_t *packet,
const uint8_t *value = packet + offset + 3;
switch (type) {
case TYPE_HEARTBEAT: {
/* Server heartbeat response — update activity timestamp */
ctx->last_activity_ms = qdx_port_get_tick_ms();
break;
}
case TYPE_ACK_PAYLOAD: {
if (len >= 3) {
uint16_t ack_seq = qdx_read_u16_le(value);
uint8_t status = value[2];
uint16_t err_code = (len >= 5) ? qdx_read_u16_le(value + 3) : 0;
DBG_LOGIC("<< [%s] ACK: seq=%d status=%d err=0x%04x\r\n",
ctx->label, (int)ack_seq, (int)status, (int)err_code);
}
break;
}
case TYPE_DEVID_ASSIGN: {
if (len >= sizeof(DevIDAssignment_t)) {
uint16_t new_id = qdx_read_u16_le(value);

View File

@ -620,8 +620,8 @@ int main(void)
{
Config2D_t test_cfg2d;
memset(&test_cfg2d, 0, sizeof(test_cfg2d));
test_cfg2d.TargetWidth = 64; /* ROI extraction 64x64 */
test_cfg2d.TargetHeight = 64;
test_cfg2d.TargetWidth = SENSOR_WIDTH; /* Full resolution */
test_cfg2d.TargetHeight = SENSOR_HEIGHT;
test_cfg2d.TriggerRoiX = 0; /* Full-frame trigger area */
test_cfg2d.TriggerRoiY = 0;
test_cfg2d.TriggerRoiW = SENSOR_WIDTH;