I m trying to get some information from my Xbee but it s not working
This is the code of my Class Test :
public static void main (String[] args){
XBee xbee = new XBee();
try {
xbee.open("COM3", 9600);
} catch (XBeeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while (true) {
try {
XBeeResponse response = xbee.getResponse(10000);
// we got a response!
} catch (XBeeTimeoutException e) {
// we timed out without a response
} catch (XBeeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
And i m using Xbee API http://code.google.com/p/xbee-api/
but always i get this errors :
com.rapplogic.xbee.api.XBeeException: AT command timed-out while attempt to set/read in API mode. The XBee radio must be in API mode (AP=2) to use with this library at com.rapplogic.xbee.api.XBee.doStartupChecks(XBee.java:124) at com.rapplogic.xbee.api.XBee.initConnection(XBee.java:170) at com.rapplogic.xbee.api.XBee.open(XBee.java:142) at com.mohamed.test.main(test.java:16)
Thank Youuuuuu