ZigBee Receive Data example for mbed XBeeLib By Digi

Dependencies:   XBeeLib mbed

Description

This example shows how to receive data from a remote XBeeZB module.
A remote XBee module sends a packet to our local XBee module though the air. The local XBee module receives the packet and sends it to the mbed module through the serial port. This library decodes the packet and calls a user defined method to process the packet.

See Receiving Data from other module 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.

While the example is running, go to the "Console" tab of the X-CTU connected to the remote XBee module. Press the "Add API frame to the list" and paste following bytes that create a new broadcast transmit request packet:

7E 00 19 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 48 65 6C 6C 6F 20 58 42 65 65 21 5A

Select the frame and press the "Send selected frame" button to send the frame ("Hello XBee!") to the XBee network.

Verify that the local XBee module has received the frame by accessing the debug interface console terminal. If it was successful, the "Hello XBee!" message will be displayed there.

Committer:
spastor
Date:
Tue May 05 18:30:05 2015 +0200
Revision:
1:6bb33e8b3b88
Parent:
0:0d348bfc487e
Child:
3:c615f29051e0
Automatic upload

Who changed what in which revision?

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