You are on page 1of 1

import import import import import import

com.rapplogic.xbee.api.XBee; com.rapplogic.xbee.api.XBeeAddress16; com.rapplogic.xbee.api.XBeeException; com.rapplogic.xbee.api.XBeeTimeoutException; com.rapplogic.xbee.api.wpan.TxRequest16; com.rapplogic.xbee.api.wpan.TxStatusResponse;

class Basictest { public static void main (String []args) { XBee xbee1=new XBee(); try { xbee1.open("COM15", 38400); } catch (XBeeException e) { // TODO Auto-generated catch block e.printStackTrace(); } }

TxRequest16 request=new TxRequest16 (new XBeeAddress16(0x56,0x78),new in t[]{'h','i',}); XBee xbee1; { TxStatusResponse response = null; try { response = (TxStatusResponse)xbee1.sendSynchronous(request,10000 ); } catch (XBeeTimeoutException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (XBeeException e) { // TODO Auto-generated catch block e.printStackTrace(); } { if(response.isSuccess()) { System.out.println("hi"); } } } boolean Catch (XBeeTimeoutException e) { // TODO: Log warning, inform someone! return false; } }