Class XBeeAdapter

  • All Implemented Interfaces:
    com.digi.xbee.api.connection.IConnectionInterface, java.util.EventListener, PortAdapter, SerialPortAdapter, purejavacomm.SerialPortEventListener

    public class XBeeAdapter
    extends SerialDriverAdapter
    implements com.digi.xbee.api.connection.IConnectionInterface, purejavacomm.SerialPortEventListener
    Provide access to IEEE802.15.4 devices via a serial com port.
    • Method Detail

      • openPort

        public java.lang.String openPort​(java.lang.String portName,
                                         java.lang.String appName)
        Description copied from interface: SerialPortAdapter
        Open a specified port.
        Specified by:
        openPort in interface SerialPortAdapter
        Overrides:
        openPort in class SerialDriverAdapter
        Parameters:
        portName - name tu use for this port
        appName - provided to the underlying OS during startup so that it can show on status displays, etc.
        Returns:
        null indicates OK return, else error message.
      • serialEvent

        public void serialEvent​(purejavacomm.SerialPortEvent e)
        Specified by:
        serialEvent in interface purejavacomm.SerialPortEventListener
      • setSerialPort

        protected void setSerialPort()
                              throws purejavacomm.UnsupportedCommOperationException
        Local method to do specific port configuration
        Overrides:
        setSerialPort in class SerialDriverAdapter
        Throws:
        purejavacomm.UnsupportedCommOperationException - if options not supported by port
      • close

        public void close()
        Specified by:
        close in interface com.digi.xbee.api.connection.IConnectionInterface
      • readData

        public int readData​(byte[] b)
                     throws java.io.IOException
        Specified by:
        readData in interface com.digi.xbee.api.connection.IConnectionInterface
        Throws:
        java.io.IOException
      • readData

        public int readData​(byte[] b,
                            int off,
                            int len)
                     throws java.io.IOException
        Specified by:
        readData in interface com.digi.xbee.api.connection.IConnectionInterface
        Throws:
        java.io.IOException
      • writeData

        public void writeData​(byte[] b)
                       throws java.io.IOException
        Specified by:
        writeData in interface com.digi.xbee.api.connection.IConnectionInterface
        Throws:
        java.io.IOException
      • writeData

        public void writeData​(byte[] b,
                              int off,
                              int len)
                       throws java.io.IOException
        Specified by:
        writeData in interface com.digi.xbee.api.connection.IConnectionInterface
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface com.digi.xbee.api.connection.IConnectionInterface
      • open

        public void open()
        Specified by:
        open in interface com.digi.xbee.api.connection.IConnectionInterface
      • getConnectionType

        public com.digi.xbee.api.connection.ConnectionType getConnectionType()
        Specified by:
        getConnectionType in interface com.digi.xbee.api.connection.IConnectionInterface