From: Olivier Matz Date: Tue, 6 May 2014 19:07:36 +0000 (+0200) Subject: fix parsing of xmit status in sendmsg command X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=84aa7ae041e790da370b7bac9a3340b73d7dc4b3;p=protos%2Fxbee-avr.git fix parsing of xmit status in sendmsg command --- diff --git a/commands.c b/commands.c index ddce65f..ff8954d 100644 --- a/commands.c +++ b/commands.c @@ -133,7 +133,7 @@ static void range_cb(struct callout_mgr *cm, static int8_t send_msg_cb(int8_t retcode, void *frame, unsigned len, void *arg) { - struct xbee_recv_hdr *recvframe = frame; + struct xbee_xmit_status_hdr *recvframe = frame; uint8_t *done = arg; *done = 1; @@ -142,7 +142,7 @@ static int8_t send_msg_cb(int8_t retcode, void *frame, unsigned len, return retcode; } if (retcode == XBEE_USER_RETCODE_BAD_FRAME || - len < sizeof(*recvframe)) { + len != sizeof(*recvframe)) { printf_P(PSTR("invalid frame\r\n")); return XBEE_USER_RETCODE_BAD_FRAME; }