My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages

Overview

This is a testing version of a Java XBee driver that use the Andrew Rapp API for communicate to an XBee device.

It provides methods for send and receive msg, and save all parameters (like address,power level, operating channel and PAN id) in a node list in form of XML tags.

From the list you can inspect all the nodes parameters on the network created by a Coordinator node.

Examples

Connect to an XBee Coordinator, get the node present on the network ad print all the nodes addresses:

XBeeCom xbeecom = new XBeeCom(); // create a new XBee communication
xbeecom.connect("/dev/tty.usbserial-A5001pBB", 9600); // connect to tty.usb... at 9600bps
xbeecom.xbeeReceiver(); //start the receiver
xbeecom.xbeeSend("ND","AT",null,null); // send an ATND command to the coordinator

sleep(1000); // wait for the discovering network. All methods are non blocking.
XBeeNode[] nodes = xbeecom.getAllNodes(); // get all nodes on the network.

for(int i = 0; i < nodes.length ; i++) // print all the nodes address
  System.out.println("Node "+i+" address: "+nodes[0].getAddress64String());



xbeecom.disconnect(); // disconnect from the xbee Coordinator
Powered by Google Project Hosting