Count and surface RX-queue drops on the ESP32-C5's promiscuous path
wifi_promisc_rx_cb() fed s_rx_queue with a 0-timeout xQueueSend() and never checked whether it succeeded, so a burst of captured frames arriving faster than rx_forward_task could drain them vanished with no counter anywhere - none of oversizeDrops/txFailures/rxCrcErrors caught it. Added a rxQueueDrops counter, threaded it through the STATUS heartbeat as a new trailing uint16 (old firmware/app on either side still parse fine), and surfaced it on the CAM Pinger card. Confirmed on the bench: flashed to the production OBU (COM3) and installed the matching app build on the phone, then watched the counter over logcat against obu-cam-transmistter's ~3.3 Hz beacon - it is real (0 -> 89 -> 90 across two sessions) but bursty around connect/reconnect rather than a continuous overflow under steady single-station traffic.
This commit is contained in:
@@ -259,8 +259,13 @@ static void wifi_promisc_rx_cb(void *recv_buf, wifi_promiscuous_pkt_type_t type)
|
||||
s_cb_item.rssi = packet->rx_ctrl.rssi;
|
||||
|
||||
// 0 timeout: never block the WiFi driver's own task waiting for queue space. xQueueSend copies
|
||||
// the struct out before returning, so reusing s_cb_item on the next callback is fine.
|
||||
xQueueSend(s_rx_queue, &s_cb_item, 0);
|
||||
// the struct out before returning, so reusing s_cb_item on the next callback is fine. The
|
||||
// return value used to go unchecked, so a full queue (rx_forward_task still draining a
|
||||
// previous burst) silently ate frames with no counter anywhere - see
|
||||
// serial_link_note_rx_queue_drop()'s KDoc.
|
||||
if (xQueueSend(s_rx_queue, &s_cb_item, 0) != pdTRUE) {
|
||||
serial_link_note_rx_queue_drop();
|
||||
}
|
||||
}
|
||||
|
||||
static void rx_forward_task(void *arg)
|
||||
|
||||
Reference in New Issue
Block a user