ZigBee Modem Status example for mbed XBeeLib By Digi

Dependencies:   XBeeLib mbed

Description

This example shows how to register a function callback to be aware of modem status changes. This library will call the registered callback whenever the XBee module radio modem changes its status

See Handling modem status changes chapter for more information.

Common Setup

Make sure you have a valid Example Common Setup

Example Setup

This example does not require any additional setup.

Running the example

Build and deploy the example to the mbed module.
Reset the mbed module so the example starts. You should see the example debug information through the debug interface configured in the 'Local Setup' chapter.

It you set up a network as described in the Common Setup section, you should see following modem status in the debug interface:

  • Modem Status 0x0: Corresponds to 'HwReset' meaning 'Hardware reset'
  • Modem Status 0x2: Corresponds to 'JoinedNW' meaning 'Joined network (ZigBee routers and end devices)'

Note: You may not see the HwReset modem status if the device is joining to the coordinator fast (within the call to xbee.init())

If you now unplug the network coordinator you should see following modem status in the debug interface:

  • Modem Status 0x3: Corresponds to 'Disassociated' meaning 'Disassociated (ZigBee)'
Revision:
2:c796a5ac7c69
Parent:
0:0c8d070617b1
--- a/config.h	Fri May 08 11:53:26 2015 +0200
+++ b/config.h	Mon May 11 18:00:40 2015 +0200
@@ -2,12 +2,12 @@
 #if !defined(__CONFIG_H_)
 #define __CONFIG_H_
 
-//#define PATFORM_ARCHPRO
+#define PATFORM_ARCHPRO
 
 /** Library configuration options */
 #define ENABLE_LOGGING
 #define ENABLE_ASSERTIONS
-#define FRAME_BUFFER_SIZE   4
+#define FRAME_BUFFER_SIZE   10
 #define MAX_FRAME_PAYLOAD_LEN  128
 #define ENABLE_PM_SUPPORT
 
@@ -16,7 +16,7 @@
 #if defined(PATFORM_ARCHPRO)
 #define RADIO_TX            P4_28
 #define RADIO_RX            P4_29
-#define RADIO_RESET         NC
+#define RADIO_RESET         P2_13
 //#define RADIO_RESET         NC
 #define RADIO_SLEEP_REQ     NC
 #define RADIO_ON_SLEEP      NC