802.15.4 AT Commands example for mbed XBeeLib By Digi

Dependencies:   XBeeLib mbed

This example shows how to read and change configuration parameters of either the local XBee module or a remote XBee module.

See Configuring local and remote modules chapter for more information.

Common Setup

Make sure you have a valid Example Common Setup

Example Setup

Application

You have to configure:

  • The remote device 64-bit address by customizing the REMOTE_NODE_ADDR64_MSB and REMOTE_NODE_ADDR64_LSB defines with the remote XBee module 64-bit address.
  • The remote device 16-bit address by customizing the REMOTE_NODE_ADDR16 define with the remote XBee module 16-bit address.

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.
The application will do following operations:

OperationXBee moduleparameterVerification
ReadlocalSLThe result is asserted against the known local module SL value. So just check the assertion passed
SetlocalNIClick 'discover remote devices' on the X-CTU connected to the remote. Should discover the local XBee module with the new NI (ni_example_local)
ReadremoteSLThe result is asserted against the known remote module SL value. So just check the assertion passed. This test is done using both 64-bit and 16-bit addressing for demonstration
SetremoteNIRefresh the 'NI' parameter in the X-CTU connected to the remote and check it has changed to the new NI (ni_example_remote)
Committer:
hbujanda
Date:
Wed Apr 29 17:11:18 2015 +0200
Revision:
0:3d9a49f93daa
Child:
2:8a72ebafdd45
Automatic upload

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hbujanda 0:3d9a49f93daa 1
hbujanda 0:3d9a49f93daa 2 #if !defined(__CONFIG_H_)
hbujanda 0:3d9a49f93daa 3 #define __CONFIG_H_
hbujanda 0:3d9a49f93daa 4
hbujanda 0:3d9a49f93daa 5 //#define PATFORM_ARCHPRO
hbujanda 0:3d9a49f93daa 6
hbujanda 0:3d9a49f93daa 7 /** Library configuration options */
hbujanda 0:3d9a49f93daa 8 #define ENABLE_LOGGING
hbujanda 0:3d9a49f93daa 9 #define ENABLE_ASSERTIONS
hbujanda 0:3d9a49f93daa 10 #define FRAME_BUFFER_SIZE 4
hbujanda 0:3d9a49f93daa 11 #define MAX_FRAME_PAYLOAD_LEN 128
hbujanda 0:3d9a49f93daa 12 #define ENABLE_PM_SUPPORT
hbujanda 0:3d9a49f93daa 13
hbujanda 0:3d9a49f93daa 14 #define SYNC_OPS_TIMEOUT_MS 2000
hbujanda 0:3d9a49f93daa 15 #define REM_SYNC_OPS_TIMEOUT_MS 3000
hbujanda 0:3d9a49f93daa 16
hbujanda 0:3d9a49f93daa 17 #if defined(PATFORM_ARCHPRO)
hbujanda 0:3d9a49f93daa 18 #define RADIO_TX P4_28
hbujanda 0:3d9a49f93daa 19 #define RADIO_RX P4_29
hbujanda 0:3d9a49f93daa 20 #define RADIO_RESET NC
hbujanda 0:3d9a49f93daa 21 //#define RADIO_RESET NC
hbujanda 0:3d9a49f93daa 22 #define RADIO_SLEEP_REQ NC
hbujanda 0:3d9a49f93daa 23 #define RADIO_ON_SLEEP NC
hbujanda 0:3d9a49f93daa 24 #define DEBUG_TX P0_2
hbujanda 0:3d9a49f93daa 25 #define DEBUG_RX P0_3
hbujanda 0:3d9a49f93daa 26 #elif defined(TARGET_LPC1768)
hbujanda 0:3d9a49f93daa 27 #define RADIO_TX p9
hbujanda 0:3d9a49f93daa 28 #define RADIO_RX p10
hbujanda 0:3d9a49f93daa 29 #define RADIO_RESET p30
hbujanda 0:3d9a49f93daa 30 #define RADIO_SLEEP_REQ NC
hbujanda 0:3d9a49f93daa 31 #define RADIO_ON_SLEEP NC
hbujanda 0:3d9a49f93daa 32 #define DEBUG_TX P0_2
hbujanda 0:3d9a49f93daa 33 #define DEBUG_RX P0_3
hbujanda 0:3d9a49f93daa 34 #elif defined(TARGET_FRDM_KL25)
hbujanda 0:3d9a49f93daa 35 #define RADIO_TX PTD3
hbujanda 0:3d9a49f93daa 36 #define RADIO_RX PTD2
hbujanda 0:3d9a49f93daa 37 #define RADIO_RESET NC
hbujanda 0:3d9a49f93daa 38 #define RADIO_SLEEP_REQ NC
hbujanda 0:3d9a49f93daa 39 #define RADIO_ON_SLEEP NC
hbujanda 0:3d9a49f93daa 40 #define DEBUG_TX USBTX
hbujanda 0:3d9a49f93daa 41 #define DEBUG_RX USBRX
hbujanda 0:3d9a49f93daa 42 #elif (defined TARGET_LPC11U24)
hbujanda 0:3d9a49f93daa 43 #define RADIO_TX p9
hbujanda 0:3d9a49f93daa 44 #define RADIO_RX p10
hbujanda 0:3d9a49f93daa 45 #define RADIO_RESET p30
hbujanda 0:3d9a49f93daa 46 #define RADIO_SLEEP_REQ NC
hbujanda 0:3d9a49f93daa 47 #define RADIO_ON_SLEEP NC
hbujanda 0:3d9a49f93daa 48 #define DEBUG_TX USBTX
hbujanda 0:3d9a49f93daa 49 #define DEBUG_RX USBRX
hbujanda 0:3d9a49f93daa 50 #else
hbujanda 0:3d9a49f93daa 51 #error "Define a platform"
hbujanda 0:3d9a49f93daa 52 #endif
hbujanda 0:3d9a49f93daa 53
hbujanda 0:3d9a49f93daa 54 #endif /* __CONFIG_H_ */
hbujanda 0:3d9a49f93daa 55