Exemplo n.º 1
0
 /**
  * Receive the next packet.
  *
  * @return the packet if one is found. If there isn't one available, returns null.
  */
 public Packet receivePacket() {
   return concentrator.getPacket(this, timeout);
 }
Exemplo n.º 2
0
 public void openSerialReadChannel() throws SocketException {
   concentrator.openSerialReadChannel(this);
   serialReadChannelOpen = true;
 }
Exemplo n.º 3
0
 /**
  * Send a packet on this connection. Calls the concentrator to actually send the packet.
  *
  * @param packet
  * @throws XBeeException
  */
 public void sendPacket(Packet packet) throws XBeeException {
   concentrator.sendPacket(packet, this);
 }
Exemplo n.º 4
0
 /** Closes this connection. */
 public void close() {
   concentrator.closeConnection(this);
 }
Exemplo n.º 5
0
 /**
  * Checks whether this connection is still open. Because the underlying protocol is
  * connection-less, this open/closed state has less to do with the state of the remote XBee device
  * and more to do with managing the concentrator's resources.
  *
  * @return
  */
 public boolean isOpen() {
   XBeeIPConnection connection = concentrator.getExstingConnection(remoteAddress);
   return connection != null;
 }
Exemplo n.º 6
0
 /**
  * @param remoteAddress
  * @throws XBeeException if the connection object can't be created. See XBeeIPConcentrator for
  *     other options.
  */
 public XBeeIPConnection(InetAddress remoteAddress) throws XBeeException {
   this.remoteAddress = remoteAddress;
   // register with the concentrator
   concentrator = XBeeIPConcentrator.getInstance();
   concentrator.registerConnection(this);
 }
Exemplo n.º 7
0
 public void closeSerialReadChannel() {
   serialReadChannelOpen = false;
   concentrator.closeSerialReadChannel(this);
 }