Package org.openmuc.eebus.spine.spi
Class Communication
- java.lang.Object
-
- org.openmuc.eebus.spine.spi.Communication
-
public abstract class Communication extends java.lang.Object
-
-
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 enabledabstract void
connect()
Connects to the network, i.e. makes the communication layer availableabstract void
disconnect()
Disconnects from the network, i.e. terminates the communication layervoid
onMessageReceived(SpineConnection connection, byte[] message)
abstract SpineConnection
open(java.lang.String address)
void
removeDevice(java.lang.String address)
void
setDevice(Device device)
-
-
-
Field Detail
-
device
protected Device device
-
-
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 messagemessage
- 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)
-
-