This commit is contained in:
2026-03-14 22:00:30 +08:00
parent 30cbf31276
commit 5275511b20
2 changed files with 17 additions and 2 deletions
@@ -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);