BL4S100 User’s Manual
109
The XBee sample programs in the Dynamic C
SAMPLES\BL4S1xx\XBee
folder illustrate
the use of the XBee function calls.
•
SLEEP.C
—This sample program demonstrates having the XBee RF module wake the
Rabbit up upon receipt of a packet.
It also demonstrates conditional use of TCP/IP networking in low-power modes. The
sample program illustrates how to respond to TCP/IP ping packets and also demon-
strates pinging a remote host. It prints a message in the Dynamic C
STDIO
window
when the ping response arrives here.
Once the sample program is compiled and running, open your PC Web browser. As
long as you have not modified the
TCPCONFIG 1
macro in the sample program, enter
the following server address in your Web browser to bring up the Web page served by
the sample program.
http://10.10.6.100
If
PING_WHO
is not defined, then it pings the default gateway.
For this sample, the
XBEE_ROLE
macro must be defined as
NODE_TYPE_ENDDEV
since
routers and coordinators cannot sleep.
•
XBEE_GPIO_SERVER.C
—This sample program shows how to set up and use endpoints
and clusters. It is meant to be run with the Windows GUI client (installed in Dynamic C’s
Utilities
directory) and a Digi USB XBee coordinator or with the GPIO client
sample program (
SAMPLES/XBEE/XBEE_GPIO_CLIENT.C
) running on an RCM4510W
RabbitCore module or on a single-board computer with an XBee RF module.
Connect the BL4S100/BL4S150 to the Demonstration Board as explained in Section 6.2.1.
Then compile and run this sample program on the BL4S100/BL4S150. Run the Windows
GUI client (
XBEE_GPIO_GUI.exe
in the Dynamic C
Utilities\XBee GPIO GUI
folder) on your PC. Configure the GUI client to connect to the Digi USB XBee coordi-
nator and scan for devices. Make sure the BL4S100/BL4S150 and the Digi USB XBee
coordinator are configured with the same PAN ID.
If you run the
XBEE_GPIO_CLIENT.C
sample program on another board with an XBee
RF module, set the PAN IDs to match between the client and the server sample programs.
Now select the GPIO server and use the GUI interface on the PC, or the command-line
client on another XBee-equipped board to view the server's inputs and change its outputs.
For example, you can toggle the LEDs on the Demonstration Board on/off.
•
XBEE_WEB_GATEWAY.C
—This sample program shows how to interact with nodes on a
wireless ZigBee network through a Web interface.
Before you compile and run this sample program, set up a ZigBee network based on
boards with the XBee RF module. The sample program provides configuration recom-
mendations for RF Interface Boards from the Mesh Network Add-On Kit and other
boards. Use the XCTU utility to configure these boards as end devices with the same
PAN ID.