diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/include/loop_uart_proto.h b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/include/loop_uart_proto.h index b3b15c8..509700a 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/include/loop_uart_proto.h +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/include/loop_uart_proto.h @@ -100,7 +100,7 @@ typedef struct { uint32_t freq; // 频率 (3 bytes, little-endian) uint16_t variation; // 变化量 (2 bytes, little-endian) union { - uint32_t passtime_ms5; // 通过时间/车间距, 5ms单位 (misc_type=0) + uint32_t passtime_ms; // 通过时间/车间距, 5ms单位 (misc_type=0) uint32_t cut_amount; // 线圈断开次数 (misc_type=1) uint32_t flow_amount; // 车流量数 (misc_type=2) uint32_t relay_count; // 继电器输出次数 (misc_type=3) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/loop_uart_proto.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/loop_uart_proto.c index 21a1f42..6ff19f3 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/loop_uart_proto.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/loop_uart_proto.c @@ -422,7 +422,7 @@ int lup_parse_sensor_report(const uint8_t *pkg, uint16_t len, LUP_SensorReport * cs->freq = c[2] | ((uint32_t)c[3] << 8) | ((uint32_t)c[4] << 16); cs->variation = c[5] | ((uint16_t)c[6] << 8); - cs->misc.passtime_ms5 = c[7] | ((uint32_t)c[8] << 8) + cs->misc.passtime_ms = c[7] | ((uint32_t)c[8] << 8) | ((uint32_t)c[9] << 16) | ((uint32_t)c[10] << 24); } diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c index fbb983e..7483aa5 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c @@ -949,8 +949,8 @@ static int format_sensor_json(char *buf, uint16_t buf_size, const LUP_SensorRepo switch (cs->misc_type) { case 0: // car_state=0(无车)→通过时间, car_state=1(有车)→车间距 - misc_field = cs->car_state ? "\"gap_ms5\"" : "\"passtime_ms5\""; - misc_val = cs->misc.passtime_ms5; + misc_field = cs->car_state ? "\"gap_ms5\"" : "\"passtime_ms\""; + misc_val = cs->misc.passtime_ms; break; case 1: misc_field = "\"cut_amount\""; misc_val = cs->misc.cut_amount; break; case 2: misc_field = "\"flow_amount\""; misc_val = cs->misc.flow_amount; break;