802.15.4 Node Discovery example for mbed XBeeLib By Digi

Dependencies:   XBeeLib mbed

Description

This example shows how to discover remote XBee modules based on their NI (Node Identifier) instead of using its 64-bit or 16-bit network address

The example demonstrates the two ways of discovering nodes:

  • Search for all nodes to identify
  • Search for only one node

See Discovering nodes in the network chapter for more information.

Common Setup

Make sure you have a valid Example Common Setup

Example Setup

You need to have your remote XBee module with a valid Node Identifier "NI" (Remember that by default its value is a space). Then customize the REMOTE_NODE_ID define in the application with that value.

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 try to discover the remote XBee module with NI equal to the defined REMOTE_NODE_ID. If found, it will send it a 'hello' message. Check in the "Console" tab of the X-CTU connected to the remote XBee module that the message arrived.
Then a node discovery function callback will be registered and a node discovery performed. All remote XBee modules in the network should answer. This library will process each answer and call the registered callback. The callback sends a 'Hello neighbor!' message to each discovered remote XBee module. Check in the "Console" tab of the X-CTU connected to the remote XBee module that the message arrived.

Committer:
spastor
Date:
Tue May 05 18:29:18 2015 +0200
Revision:
1:02a629546d70
Parent:
0:7be0794fb24f
Child:
3:44059a052f3a
Automatic upload

Who changed what in which revision?

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