DigiMesh Node Discovery example for mbed XBeeLib By Digi
Fork of XBeeZB_node_discovery by
Description
This example shows how to discover remote XBee modules based on their NI (Node Identifier) instead of using its 64-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.
Once joined to the coordinator, 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.
config.h@0:52b14877e9eb, 2015-04-29 (annotated)
- Committer:
- hbujanda
- Date:
- Wed Apr 29 18:11:56 2015 +0200
- Revision:
- 0:52b14877e9eb
- Child:
- 1:8bb1b111d52a
Automatic upload
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hbujanda | 0:52b14877e9eb | 1 | |
hbujanda | 0:52b14877e9eb | 2 | #if !defined(__CONFIG_H_) |
hbujanda | 0:52b14877e9eb | 3 | #define __CONFIG_H_ |
hbujanda | 0:52b14877e9eb | 4 | |
hbujanda | 0:52b14877e9eb | 5 | //#define PATFORM_ARCHPRO |
hbujanda | 0:52b14877e9eb | 6 | |
hbujanda | 0:52b14877e9eb | 7 | /** Library configuration options */ |
hbujanda | 0:52b14877e9eb | 8 | #define ENABLE_LOGGING |
hbujanda | 0:52b14877e9eb | 9 | #define ENABLE_ASSERTIONS |
hbujanda | 0:52b14877e9eb | 10 | #define FRAME_BUFFER_SIZE 4 |
hbujanda | 0:52b14877e9eb | 11 | #define MAX_FRAME_PAYLOAD_LEN 128 |
hbujanda | 0:52b14877e9eb | 12 | #define ENABLE_PM_SUPPORT |
hbujanda | 0:52b14877e9eb | 13 | |
hbujanda | 0:52b14877e9eb | 14 | #define SYNC_OPS_TIMEOUT_MS 2000 |
hbujanda | 0:52b14877e9eb | 15 | #define REM_SYNC_OPS_TIMEOUT_MS 3000 |
hbujanda | 0:52b14877e9eb | 16 | |
hbujanda | 0:52b14877e9eb | 17 | #if defined(PATFORM_ARCHPRO) |
hbujanda | 0:52b14877e9eb | 18 | #define RADIO_TX P4_28 |
hbujanda | 0:52b14877e9eb | 19 | #define RADIO_RX P4_29 |
hbujanda | 0:52b14877e9eb | 20 | #define RADIO_RESET NC |
hbujanda | 0:52b14877e9eb | 21 | //#define RADIO_RESET NC |
hbujanda | 0:52b14877e9eb | 22 | #define RADIO_SLEEP_REQ NC |
hbujanda | 0:52b14877e9eb | 23 | #define RADIO_ON_SLEEP NC |
hbujanda | 0:52b14877e9eb | 24 | #define DEBUG_TX P0_2 |
hbujanda | 0:52b14877e9eb | 25 | #define DEBUG_RX P0_3 |
hbujanda | 0:52b14877e9eb | 26 | #elif defined(TARGET_LPC1768) |
hbujanda | 0:52b14877e9eb | 27 | #define RADIO_TX p9 |
hbujanda | 0:52b14877e9eb | 28 | #define RADIO_RX p10 |
hbujanda | 0:52b14877e9eb | 29 | #define RADIO_RESET p30 |
hbujanda | 0:52b14877e9eb | 30 | #define RADIO_SLEEP_REQ NC |
hbujanda | 0:52b14877e9eb | 31 | #define RADIO_ON_SLEEP NC |
hbujanda | 0:52b14877e9eb | 32 | #define DEBUG_TX P0_2 |
hbujanda | 0:52b14877e9eb | 33 | #define DEBUG_RX P0_3 |
hbujanda | 0:52b14877e9eb | 34 | #elif defined(TARGET_FRDM_KL25) |
hbujanda | 0:52b14877e9eb | 35 | #define RADIO_TX PTD3 |
hbujanda | 0:52b14877e9eb | 36 | #define RADIO_RX PTD2 |
hbujanda | 0:52b14877e9eb | 37 | #define RADIO_RESET NC |
hbujanda | 0:52b14877e9eb | 38 | #define RADIO_SLEEP_REQ NC |
hbujanda | 0:52b14877e9eb | 39 | #define RADIO_ON_SLEEP NC |
hbujanda | 0:52b14877e9eb | 40 | #define DEBUG_TX USBTX |
hbujanda | 0:52b14877e9eb | 41 | #define DEBUG_RX USBRX |
hbujanda | 0:52b14877e9eb | 42 | #elif (defined TARGET_LPC11U24) |
hbujanda | 0:52b14877e9eb | 43 | #define RADIO_TX p9 |
hbujanda | 0:52b14877e9eb | 44 | #define RADIO_RX p10 |
hbujanda | 0:52b14877e9eb | 45 | #define RADIO_RESET p30 |
hbujanda | 0:52b14877e9eb | 46 | #define RADIO_SLEEP_REQ NC |
hbujanda | 0:52b14877e9eb | 47 | #define RADIO_ON_SLEEP NC |
hbujanda | 0:52b14877e9eb | 48 | #define DEBUG_TX USBTX |
hbujanda | 0:52b14877e9eb | 49 | #define DEBUG_RX USBRX |
hbujanda | 0:52b14877e9eb | 50 | #else |
hbujanda | 0:52b14877e9eb | 51 | #error "Define a platform" |
hbujanda | 0:52b14877e9eb | 52 | #endif |
hbujanda | 0:52b14877e9eb | 53 | |
hbujanda | 0:52b14877e9eb | 54 | #endif /* __CONFIG_H_ */ |
hbujanda | 0:52b14877e9eb | 55 |