From: Olivier Matz Date: Thu, 7 Nov 2013 19:15:36 +0000 (+0100) Subject: xbee stats should be u32 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4989a2c76e8fa25667663a215709f9366747fcad;p=protos%2Fxbee-avr.git xbee stats should be u32 --- diff --git a/xbee_stats.c b/xbee_stats.c index 7913325..cadc9f6 100644 --- a/xbee_stats.c +++ b/xbee_stats.c @@ -50,33 +50,32 @@ void xbee_reset_stats(struct xbee_dev *dev) memset(&dev->stats, 0, sizeof(dev->stats)); } -//XXX printf_P void xbee_dump_stats(struct xbee_dev *dev) { printf_P(PSTR("statistics on xbee_dev %p:\r\n"), dev); - printf_P(PSTR(" rx_frame: %d\r\n"), dev->stats.rx_frame); - printf_P(PSTR(" rx_atresp: %d\r\n"), dev->stats.rx_atresp); - printf_P(PSTR(" rx_atresp_error: %d\r\n"), dev->stats.rx_atresp_error); - printf_P(PSTR(" rx_modem_status: %d\r\n"), dev->stats.rx_modem_status); - printf_P(PSTR(" rx_xmit_status: %d\r\n"), dev->stats.rx_xmit_status); - printf_P(PSTR(" rx_xmit_status_error: %d\r\n"), dev->stats.rx_xmit_status_error); - printf_P(PSTR(" rx_data: %d\r\n"), dev->stats.rx_data); - printf_P(PSTR(" rx_expl_data: %d\r\n"), dev->stats.rx_expl_data); - printf_P(PSTR(" rx_node_id: %d\r\n"), dev->stats.rx_node_id); - printf_P(PSTR(" rx_rmt_atresp: %d\r\n"), dev->stats.rx_rmt_atresp); - printf_P(PSTR(" rx_rmt_atresp_error: %d\r\n"), dev->stats.rx_rmt_atresp_error); - printf_P(PSTR(" rx_frame_too_small: %d\r\n"), dev->stats.rx_frame_too_small); - printf_P(PSTR(" rx_frame_too_large: %d\r\n"), dev->stats.rx_frame_too_large); - printf_P(PSTR(" rx_invalid_cksum: %d\r\n"), dev->stats.rx_invalid_cksum); - printf_P(PSTR(" rx_invalid_type: %d\r\n"), dev->stats.rx_invalid_type); - printf_P(PSTR(" rx_no_delim: %d\r\n"), dev->stats.rx_no_delim); - printf_P(PSTR(" tx_frame: %d\r\n"), dev->stats.tx_frame); - printf_P(PSTR(" tx_atcmd: %d\r\n"), dev->stats.tx_atcmd); - printf_P(PSTR(" tx_atcmd_q: %d\r\n"), dev->stats.tx_atcmd_q); - printf_P(PSTR(" tx_data: %d\r\n"), dev->stats.tx_data); - printf_P(PSTR(" tx_expl_data: %d\r\n"), dev->stats.tx_expl_data); - printf_P(PSTR(" tx_xmit_retries: %d\r\n"), dev->stats.tx_xmit_retries); - printf_P(PSTR(" tx_rmt_atcmd: %d\r\n"), dev->stats.tx_rmt_atcmd); - printf_P(PSTR(" tx_invalid_type: %d\r\n"), dev->stats.tx_invalid_type); - printf_P(PSTR(" tx_invalid_channel: %d\r\n"), dev->stats.tx_invalid_channel); + printf_P(PSTR(" rx_frame: %"PRIu32"\r\n"), dev->stats.rx_frame); + printf_P(PSTR(" rx_atresp: %"PRIu32"\r\n"), dev->stats.rx_atresp); + printf_P(PSTR(" rx_atresp_error: %"PRIu32"\r\n"), dev->stats.rx_atresp_error); + printf_P(PSTR(" rx_modem_status: %"PRIu32"\r\n"), dev->stats.rx_modem_status); + printf_P(PSTR(" rx_xmit_status: %"PRIu32"\r\n"), dev->stats.rx_xmit_status); + printf_P(PSTR(" rx_xmit_status_error: %"PRIu32"\r\n"), dev->stats.rx_xmit_status_error); + printf_P(PSTR(" rx_data: %"PRIu32"\r\n"), dev->stats.rx_data); + printf_P(PSTR(" rx_expl_data: %"PRIu32"\r\n"), dev->stats.rx_expl_data); + printf_P(PSTR(" rx_node_id: %"PRIu32"\r\n"), dev->stats.rx_node_id); + printf_P(PSTR(" rx_rmt_atresp: %"PRIu32"\r\n"), dev->stats.rx_rmt_atresp); + printf_P(PSTR(" rx_rmt_atresp_error: %"PRIu32"\r\n"), dev->stats.rx_rmt_atresp_error); + printf_P(PSTR(" rx_frame_too_small: %"PRIu32"\r\n"), dev->stats.rx_frame_too_small); + printf_P(PSTR(" rx_frame_too_large: %"PRIu32"\r\n"), dev->stats.rx_frame_too_large); + printf_P(PSTR(" rx_invalid_cksum: %"PRIu32"\r\n"), dev->stats.rx_invalid_cksum); + printf_P(PSTR(" rx_invalid_type: %"PRIu32"\r\n"), dev->stats.rx_invalid_type); + printf_P(PSTR(" rx_no_delim: %"PRIu32"\r\n"), dev->stats.rx_no_delim); + printf_P(PSTR(" tx_frame: %"PRIu32"\r\n"), dev->stats.tx_frame); + printf_P(PSTR(" tx_atcmd: %"PRIu32"\r\n"), dev->stats.tx_atcmd); + printf_P(PSTR(" tx_atcmd_q: %"PRIu32"\r\n"), dev->stats.tx_atcmd_q); + printf_P(PSTR(" tx_data: %"PRIu32"\r\n"), dev->stats.tx_data); + printf_P(PSTR(" tx_expl_data: %"PRIu32"\r\n"), dev->stats.tx_expl_data); + printf_P(PSTR(" tx_xmit_retries: %"PRIu32"\r\n"), dev->stats.tx_xmit_retries); + printf_P(PSTR(" tx_rmt_atcmd: %"PRIu32"\r\n"), dev->stats.tx_rmt_atcmd); + printf_P(PSTR(" tx_invalid_type: %"PRIu32"\r\n"), dev->stats.tx_invalid_type); + printf_P(PSTR(" tx_invalid_channel: %"PRIu32"\r\n"), dev->stats.tx_invalid_channel); } diff --git a/xbee_stats.h b/xbee_stats.h index 539542b..257aeb5 100644 --- a/xbee_stats.h +++ b/xbee_stats.h @@ -30,32 +30,32 @@ /* per-device statistics */ struct xbee_stats { - int rx_frame; - int rx_atresp; - int rx_atresp_error; - int rx_modem_status; - int rx_xmit_status; - int rx_xmit_status_error; - int rx_data; - int rx_expl_data; - int rx_node_id; - int rx_rmt_atresp; - int rx_rmt_atresp_error; - int rx_frame_too_small; - int rx_frame_too_large; - int rx_invalid_cksum; - int rx_invalid_type; - int rx_no_delim; + uint32_t rx_frame; + uint32_t rx_atresp; + uint32_t rx_atresp_error; + uint32_t rx_modem_status; + uint32_t rx_xmit_status; + uint32_t rx_xmit_status_error; + uint32_t rx_data; + uint32_t rx_expl_data; + uint32_t rx_node_id; + uint32_t rx_rmt_atresp; + uint32_t rx_rmt_atresp_error; + uint32_t rx_frame_too_small; + uint32_t rx_frame_too_large; + uint32_t rx_invalid_cksum; + uint32_t rx_invalid_type; + uint32_t rx_no_delim; - int tx_frame; - int tx_atcmd; - int tx_atcmd_q; - int tx_data; - int tx_expl_data; - int tx_xmit_retries; - int tx_rmt_atcmd; - int tx_invalid_type; - int tx_invalid_channel; + uint32_t tx_frame; + uint32_t tx_atcmd; + uint32_t tx_atcmd_q; + uint32_t tx_data; + uint32_t tx_expl_data; + uint32_t tx_xmit_retries; + uint32_t tx_rmt_atcmd; + uint32_t tx_invalid_type; + uint32_t tx_invalid_channel; }; struct xbee_dev;