2 * Copyright (c) 2011, Olivier MATZ <zer0@droids-corp.org>
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the University of California, Berkeley nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <aversive/pgmspace.h>
30 #include <aversive/queue.h>
37 #include "xbee_neighbor.h"
38 #include "xbee_stats.h"
39 #include "xbee_proto.h"
43 struct xbee_stats *xbee_get_stats(struct xbee_dev *dev)
48 void xbee_reset_stats(struct xbee_dev *dev)
50 memset(&dev->stats, 0, sizeof(dev->stats));
54 void xbee_dump_stats(struct xbee_dev *dev)
56 printf_P(PSTR("statistics on xbee_dev %p:\r\n"), dev);
57 printf_P(PSTR(" rx_frame: %d\r\n"), dev->stats.rx_frame);
58 printf_P(PSTR(" rx_atresp: %d\r\n"), dev->stats.rx_atresp);
59 printf_P(PSTR(" rx_atresp_error: %d\r\n"), dev->stats.rx_atresp_error);
60 printf_P(PSTR(" rx_modem_status: %d\r\n"), dev->stats.rx_modem_status);
61 printf_P(PSTR(" rx_xmit_status: %d\r\n"), dev->stats.rx_xmit_status);
62 printf_P(PSTR(" rx_xmit_status_error: %d\r\n"), dev->stats.rx_xmit_status_error);
63 printf_P(PSTR(" rx_data: %d\r\n"), dev->stats.rx_data);
64 printf_P(PSTR(" rx_expl_data: %d\r\n"), dev->stats.rx_expl_data);
65 printf_P(PSTR(" rx_node_id: %d\r\n"), dev->stats.rx_node_id);
66 printf_P(PSTR(" rx_rmt_atresp: %d\r\n"), dev->stats.rx_rmt_atresp);
67 printf_P(PSTR(" rx_rmt_atresp_error: %d\r\n"), dev->stats.rx_rmt_atresp_error);
68 printf_P(PSTR(" rx_frame_too_small: %d\r\n"), dev->stats.rx_frame_too_small);
69 printf_P(PSTR(" rx_frame_too_large: %d\r\n"), dev->stats.rx_frame_too_large);
70 printf_P(PSTR(" rx_invalid_cksum: %d\r\n"), dev->stats.rx_invalid_cksum);
71 printf_P(PSTR(" rx_invalid_type: %d\r\n"), dev->stats.rx_invalid_type);
72 printf_P(PSTR(" rx_no_delim: %d\r\n"), dev->stats.rx_no_delim);
73 printf_P(PSTR(" tx_frame: %d\r\n"), dev->stats.tx_frame);
74 printf_P(PSTR(" tx_atcmd: %d\r\n"), dev->stats.tx_atcmd);
75 printf_P(PSTR(" tx_atcmd_q: %d\r\n"), dev->stats.tx_atcmd_q);
76 printf_P(PSTR(" tx_data: %d\r\n"), dev->stats.tx_data);
77 printf_P(PSTR(" tx_expl_data: %d\r\n"), dev->stats.tx_expl_data);
78 printf_P(PSTR(" tx_xmit_retries: %d\r\n"), dev->stats.tx_xmit_retries);
79 printf_P(PSTR(" tx_rmt_atcmd: %d\r\n"), dev->stats.tx_rmt_atcmd);
80 printf_P(PSTR(" tx_invalid_type: %d\r\n"), dev->stats.tx_invalid_type);
81 printf_P(PSTR(" tx_invalid_channel: %d\r\n"), dev->stats.tx_invalid_channel);