naxbeeecho: This sample application helps you to write ZigBee socket applications.

It can run on any platform which has more than 1 serial port. 

What it does?
=============
It is a simple Echo Server which sends back the received data on XBee radio
which is connected to the serial port.

Additional Hardware requirements
================================
XBee Development Boards
    XBIB-R-DEV: RS-232 female carrier board for ZigBee modules

XBee Modules
    XB24-Z7WIT-001: ZigBee coordinator XBee module, wire antenna
    XB24-Z7WIT-004: ZigBee router/end device XBee module, wire antenna

XBee-PRO Modules
    XBP24BZ7WIT-001: ZigBee coordinator XBee-PRO module (longer range) , wire
    antenna
    XBP24BZ7WIT-004: ZigBee router/end device XBee-PRO module (longer range) ,
    wire antenna

Additional variants are available. Please visit the Digi website for detailed
product information.

For educational material on ZigBee technology, please also visit
http://www.digi.com/news/videos.jsp.

Hardware installation RS-232 female carrier board
=================================================
1. Install XB24-Z7WIT-001: ZigBee coordinator XBee module into the RS-232
   female carrier board.
2. Using the serial cable supplied, connect the RS-232 board to the serial
   port on your device you will be using for the XBee device.
3. Attach the power supply to the RS-232 Interface Board and the power
   cable to an outlet.

Software installation of X-CTU
==============================
1. From the X-CTU folder, run xctu_installer.exe and follow the directions.

Hardware installation USB carrier board
=======================================
1. Install XB24-Z7WIT-004: ZigBee router/end device XBee module into the USB
   carrier board.
2. Connect one end of the USB cable to your PC, and the other end to the USB
   carrier board.  If you have not installed the Maxstream driver, continue
   with steps 3 - 8.
3. The New Hardware Wizard should start so you can install software for
   Maxstream PKG-U.
4. Select install from a specific location (Advanced)
5. Browse to X-CTU\WINDOWS drivers and continue the installation.
6. The New Hardware Wizard should start so you can install software for USB
   Serial Port
7. Select install from a specific location (Advanced)
8. Browse to X-CTU\WINDOWS drivers and continue the installation.

Software setup
==============
1.  Open X-CTU by selecting Programs => Digi => X-CTU
2.  Under select com port, highlight the line with Digi PKG-U Serial.
3.  Uncheck the Enable API checkbox, and set the baud rate to 9600  
4.  Hit the Test / Query Button.  You should see Modem type=XB24-B, and Modem
    firmware version=2264.  
5.  If you cannot communicate with the XBee module,	make sure the XBee is
    propery inserted into the socket.

Serial port options
===================
The following are some serial port options you can have on different
platforms:

1.  For the Digi Connect ME 9210 and Digi Connect Wi-EM 9210 connect the XBee
    deviceto serial port 1 (/com/0) and use serial port 2 (/com/2) for dialog.
2.  For the 9P 9215, Wi-9P 9215, ns9210 connect the XBee device to serial port
    B and use serial port D for dialog.
3.  For connect ME, Connect Wi-ME, Connect EM and Connect Wi-EM connect the
    XBee device to serial port A and use serial port B for dialog.
4.  For all other platforms, connect the XBee device to serial port B and use
    serial port A for dialog.

What is required to run this sample?
====================================
NET+OS device serial port which supports hardware handshake. Which ever
serial port you select to communicate with XBee radio, make sure it is

1.  The serial port is not used for dialog, std I/O, CLI or simple serial.
    Related files are bsp_sys.h, bsp_serial.h, bsp_cli.h under respective
    bsp/platforms directory.
2.  Configured at least as 4 wires uart (gpio.h)
3.  Set BSP_XBEE_PORT in <platform>/bsp_serial.h to the selected port
    
Running the sample
==================
1.  The sample first tries to initialize the ZigBee socket, and bind to an
    application endpoint.
2.  It then calls "select" to wait to receive data on the ZigBee socket.
3.  Click on the terminal tab in X-CTU.
4.  Click in the Assemble Packet button, and type some characters in the Send
    Packet window.
5.  Click on the Send Data button.
6.  You should see something like this in the terminal window;

zbEcho: recv'd 4 bytes from [00:13:a2:00:40:52:16:b3]!e8@c105/0011
zbEcho: sending frame back to source.
zbEcho: 4 bytes sent successfully.

7.  If you do not see anything, you should see alternate LED blinks between
    LED 4, and the bottom left red LED in the group of 6 LEDs on the USB board.
    If you do not hit hit the reset button S6 on the USB board, and re-run the
    sample.
8.  If you still do not see anything, hit SW1 4	times quickly on the USB board.
    The blinking should stop temporarily, and the red LED will go solid.  This
    will default the XBee module, re-run the sample.
