From 046a94e3630ed3fe6df91fd1976b5df2a1c5261e Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Fri, 15 Sep 2017 19:41:24 +0000 Subject: [PATCH] Merged in merlin17/nuttx (pull request #485) drivers/xbee: Fixes a few warnings * drivers/xbee: Fixes a few warnings * configs/clicker2-stm32: Updates sections about i8sak usage in the README Approved-by: Gregory Nutt --- configs/clicker2-stm32/README.txt | 38 +++++++++++---------- drivers/wireless/ieee802154/xbee/xbee.c | 4 +-- drivers/wireless/ieee802154/xbee/xbee_mac.c | 3 +- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index 0f430595df..6e2086f8e1 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -362,7 +362,7 @@ Configurations 1. Configure the Coordinator. On coordinator device do: - nsh> i8 /dev/ieee0 startpan + nsh> i8 /dev/ieee0 startpan cd:ab nsh> i8 acceptassoc 2. Assocate an endpoint device with the WPAN. On the endpoint @@ -432,10 +432,12 @@ Configurations 5. IPv6 networking is enabled with TCP/IP, UDP, 6LoWPAN, and NSH Telnet support. - 6. Configuration instructions: Basic PAN configuration is the same as - for the ieee802154-mac configuration with the exception that after - the PAN has been configured with the i8sak utility, you must - explicity bring the network up on each node: + 6. Configuration instructions: Basic PAN configuration is similar to the + mrf24j40-mac configuration with the exception that you use the network + interface name 'wpan0'. This tells the i8sak app to use a socket + instead of a character device to perform the IOCTL operations with the + MAC. Additionally, after the PAN has been configured with the i8sak + utility, you must explicity bring the network up on each node: nsh> ifup wpan0 @@ -459,9 +461,9 @@ Configurations Cheat Sheet. Here is a concise summary of all all the steps needed to run the UDP test (C=Coordinator; E=Endpoint): - C: nsh> i8 /dev/ieee0 startpan - C: nsh> 8 acceptassoc - E: nsh> i8 assoc + C: nsh> i8 wpan0 startpan cd:ab + C: nsh> i8 acceptassoc + E: nsh> i8 wpan0 assoc C: nsh> ifup wpan0 C: nsh> ifconfig <-- To get the E: nsh> ifup wpan0 @@ -491,9 +493,9 @@ Configurations Cheat Sheet. Here is a concise summary of all all the steps needed to run the TCP test (C=Coordinator; E=Endpoint): - C: nsh> i8 /dev/ieee0 startpan - C: nsh> 8 acceptassoc - E: nsh> i8 assoc + C: nsh> i8 wpan0 startpan cd:ab + C: nsh> i8 acceptassoc + E: nsh> i8 wpan0 assoc C: nsh> ifup wpan0 C: nsh> ifconfig <-- To get the E: nsh> ifup wpan0 @@ -531,9 +533,9 @@ Configurations Cheat Sheet. Here is a concise summary of all all the steps needed to run the TCP test (C=Coordinator; E=Endpoint): - C: nsh> i8 /dev/ieee0 startpan - C: nsh> 8 acceptassoc - E: nsh> i8 assoc + C: nsh> i8 wpan0 startpan + C: nsh> i8 acceptassoc + E: nsh> i8 wpan0 assoc C: nsh> ifup wpan0 C: nsh> ifconfig <-- To get the E: nsh> ifup wpan0 @@ -633,10 +635,10 @@ Configurations representing the two star endpoints and C: representing the coordinator/hub. - C: nsh> i8 /dev/ieee0 startpan - C: nsh> 8 acceptassoc - E1: nsh> i8 assoc - E2: nsh> i8 assoc + C: nsh> i8 wpan0 startpan cd:ab + C: nsh> i8 acceptassoc + E1: nsh> i8 wpan0 assoc + E2: nsh> i8 wpan0 assoc C: nsh> ifup wpan0 E1: nsh> ifup wpan0 E1: nsh> ifconfig <-- To get the IP address of E1 endpoint diff --git a/drivers/wireless/ieee802154/xbee/xbee.c b/drivers/wireless/ieee802154/xbee/xbee.c index 2e547e9fe5..81a9a6f852 100644 --- a/drivers/wireless/ieee802154/xbee/xbee.c +++ b/drivers/wireless/ieee802154/xbee/xbee.c @@ -155,7 +155,7 @@ static void xbee_attnworker(FAR void *arg) FAR struct iob_s *iobhead = NULL; FAR struct iob_s *iob = NULL; FAR struct iob_s *previob = NULL; - uint16_t rxframelen; + uint16_t rxframelen = 0; DEBUGASSERT(priv); DEBUGASSERT(priv->spi); @@ -911,7 +911,7 @@ void xbee_send_apiframe(FAR struct xbee_priv_s *priv, FAR struct iob_s *iob; FAR struct iob_s *previob; FAR struct iob_s *iobhead; - uint16_t rxframelen; + uint16_t rxframelen = 0; int i; /* Get access to SPI bus, set relevant settings */ diff --git a/drivers/wireless/ieee802154/xbee/xbee_mac.c b/drivers/wireless/ieee802154/xbee/xbee_mac.c index b4e092e22e..1d22695a78 100644 --- a/drivers/wireless/ieee802154/xbee/xbee_mac.c +++ b/drivers/wireless/ieee802154/xbee/xbee_mac.c @@ -264,8 +264,9 @@ int xbee_req_data(XBEEHANDLE xbee, int index; uint16_t apiframelen; uint8_t frametype; - +#ifdef CONFIG_DEBUG_ASSERTIONS int prevoffs = frame->io_offset; +#endif /* Figure out how much room we need to place the API frame header */