Class Communication


  • public abstract class Communication
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Device device  
    • Constructor Summary

      Constructors 
      Constructor Description
      Communication()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addDevice​(java.lang.String communicationAddress)
      Notifies device listeners of this device and starts the detailed discovery process if enabled
      abstract void connect()
      Connects to the network, i.e. makes the communication layer available
      abstract void disconnect()
      Disconnects from the network, i.e. terminates the communication layer
      void onMessageReceived​(SpineConnection connection, byte[] message)  
      abstract SpineConnection open​(java.lang.String address)  
      void removeDevice​(java.lang.String address)  
      void setDevice​(Device device)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • device

        protected Device device
    • Constructor Detail

      • Communication

        public Communication()
    • Method Detail

      • connect

        public abstract void connect()
        Connects to the network, i.e. makes the communication layer available
      • disconnect

        public abstract void disconnect()
        Disconnects from the network, i.e. terminates the communication layer
      • open

        public abstract SpineConnection open​(java.lang.String address)
        Parameters:
        address - the address used in the communication protocol, i.e. not the SPINE device address
        Returns:
        a connection to the requested device
      • setDevice

        public void setDevice​(Device device)
      • onMessageReceived

        public void onMessageReceived​(SpineConnection connection,
                                      byte[] message)
        Parameters:
        connection - the connection associated to the received message
        message - the received message as a byte array
      • addDevice

        public void addDevice​(java.lang.String communicationAddress)
        Notifies device listeners of this device and starts the detailed discovery process if enabled
        Parameters:
        communicationAddress - the address of a newly discovered device
      • removeDevice

        public void removeDevice​(java.lang.String address)