X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=xbee_user.c;h=9d3da9955879e30dcc66fe5740a8597d8dd91b42;hp=a4cb84f54499d859567f758b681c492f58f39892;hb=f820d95b15d8bbb7c289acf92f31848d218825a7;hpb=0373c0e13f4a81426ee5084c0c1ee148bc6b935a diff --git a/xbee_user.c b/xbee_user.c index a4cb84f..9d3da99 100644 --- a/xbee_user.c +++ b/xbee_user.c @@ -56,6 +56,8 @@ int xbee_cmdline_input_enabled = 1; /* parameters */ int xbee_raw = 0; +static struct callout xbee_rx_poll_timer; + static void __hexdump(const void *buf, unsigned int len) { unsigned int i, out, ofs; @@ -235,7 +237,9 @@ static int parse_atcmd(struct xbee_ctx *ctx, struct xbee_atresp_hdr *frame, } -/* main rx entry point for application */ +/* Main xbee rx entry point for application. It decodes the xbee frame type and + * dispatch to the application layer. Then "len" argument does not include the + * xbee_hdr structure (delimiter, len, type, id) and checksum. */ int8_t xbeeapp_rx(struct xbee_dev *dev, int channel, int type, void *frame, unsigned len, void *opaque) { @@ -544,8 +548,8 @@ void xbee_stdin_disable(void) void xbeeapp_init(void) { - callout_init(&xbeeboard.xbee_rx_poll_timer, xbee_rx_poll_timer_cb, + callout_init(&xbee_rx_poll_timer, xbee_rx_poll_timer_cb, NULL, XBEE_PRIO); - callout_schedule(&xbeeboard.intr_cm, - &xbeeboard.xbee_rx_poll_timer, XBEE_POLL_TIMER_MS); + callout_schedule(&xbeeboard.intr_cm, &xbee_rx_poll_timer, + XBEE_POLL_TIMER_MS); }