802.15.4 Receive Data example for mbed XBeeLib By Digi

Dependencies:   XBeeLib mbed

Description

This example shows how to receive data from a remote XBee802 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:28:53 2015 +0200
Revision:
1:bf4296cf56cb
Parent:
0:155647ac203f
Child:
3:4cb764d44eac
Automatic upload

Who changed what in which revision?

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