nimble/ll/dtm: Add stat to count RX packets in real-time
#include "ble_ll_dtm_priv.h"
STATS_SECT_START(ble_ll_dtm_stats)
+ STATS_SECT_ENTRY(rx_count)
STATS_SECT_ENTRY(tx_failed)
STATS_SECT_ENTRY(rx_failed)
STATS_SECT_END
STATS_SECT_DECL(ble_ll_dtm_stats) ble_ll_dtm_stats;
STATS_NAME_START(ble_ll_dtm_stats)
+ STATS_NAME(ble_ll_dtm_stats, rx_count)
STATS_NAME(ble_ll_dtm_stats, tx_failed)
STATS_NAME(ble_ll_dtm_stats, rx_failed)
STATS_NAME_END(ble_phy_stats)
@@ -392,6 +394,8 @@ ble_ll_dtm_rx_create_ctx(uint8_t rf_channel, uint8_t phy_mode)
g_ble_ll_dtm_ctx.rf_channel = rf_channel;
g_ble_ll_dtm_ctx.active = 1;
+ STATS_CLEAR(ble_ll_dtm_stats, rx_count);
+
ble_npl_event_init(&g_ble_ll_dtm_ctx.evt, ble_ll_dtm_ev_rx_restart_cb,
NULL);
@@ -537,6 +541,7 @@ ble_ll_dtm_rx_pkt_in(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
if (BLE_MBUF_HDR_CRC_OK(hdr)) {
/* XXX Compare data. */
g_ble_ll_dtm_ctx.num_of_packets++;
+ STATS_INC(ble_ll_dtm_stats, rx_count);
}
if (ble_ll_dtm_rx_start() != 0) {
