Skip to content

Commit

Permalink
Merged in antmerlino/nuttx/xbee-timeout-fix (pull request #656)
Browse files Browse the repository at this point in the history
drivers/xbee: Fixes issue with timeouts.  Timeouts were in ticks but should have been in ms.  This caused false triggers of timeout causing redundant packets, etc.

Approved-by: GregoryN <gnutt@nuttx.org>
  • Loading branch information
antmerlino authored and gregory-nutt committed Jun 13, 2018
1 parent fd43981 commit 2f921fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion drivers/wireless/ieee802154/xbee/xbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* Pre-processor Definitions
****************************************************************************/

#define XBEE_ATQUERY_TIMEOUT 100
#define XBEE_ATQUERY_TIMEOUT MSEC2TICK(100)

/****************************************************************************
* Private Types
Expand Down Expand Up @@ -625,6 +625,11 @@ static void xbee_process_apiframes(FAR struct xbee_priv_s *priv,
wlinfo("Sleep Period: %dsec\n",
frame->io_data[frame->io_offset]/100);
}
else if (memcmp(command, "RR", 2) == 0)
{
wlinfo("XBee Retries: %d\n",
frame->io_data[frame->io_offset]);
}
else
{
wlwarn("Unhandled AT Response: %.*s\n", 2, command);
Expand Down Expand Up @@ -1557,4 +1562,5 @@ void xbee_regdump(FAR struct xbee_priv_s *priv)
xbee_send_atquery(priv, "A1");
xbee_send_atquery(priv, "A2");
xbee_send_atquery(priv, "SP");
xbee_send_atquery(priv, "RR");
}
3 changes: 2 additions & 1 deletion drivers/wireless/ieee802154/xbee/xbee_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
****************************************************************************/

#define XBEE_ASSOC_POLLDELAY 100
#define XBEE_RESPONSE_TIMEOUT 100

#define XBEE_RESPONSE_TIMEOUT MSEC2TICK(100)

/****************************************************************************
* Private Types
Expand Down

0 comments on commit 2f921fb

Please sign in to comment.