Class AbstractDevice
- java.lang.Object
-
- io.patriot_framework.generator.device.AbstractDevice
-
- Direct Known Subclasses:
AbstractActuator
,AbstractSensor
public abstract class AbstractDevice extends Object implements Device
-
-
Constructor Summary
Constructors Constructor Description AbstractDevice()
AbstractDevice(String label)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoapController
getCoapController()
Returns CoapController for DeviceDataObservable
getDataObservable()
Returns DataObservable for DeviceString
getLabel()
Returns LabelNetworkAdapter
getNetworkAdapter()
Returns NetworkAdapter assigned to DeviceUUID
getUUID()
Returns UUIDvoid
setCoapController(CoapController coapController)
Sets CoapController for Devicevoid
setDataObservable(DataObservable dataObservable)
Sets DataObservable for Device.void
setLabel(String label)
Sets Labelvoid
setNetworkAdapter(NetworkAdapter networkAdapter)
Sets Network Adapter for device which enables sending data wivoid
setUUID(UUID uuid)
Sets UUIDvoid
startCoapController()
Enables CoaP communication with Device.void
stopCoapController()
Remove allResource
endpoints for Device from CoaP Server, in order to deny CoaP communication with instance of Device.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.patriot_framework.generator.device.Device
requestData
-
-
-
-
Constructor Detail
-
AbstractDevice
public AbstractDevice()
-
AbstractDevice
public AbstractDevice(String label)
-
-
Method Detail
-
startCoapController
public void startCoapController()
Description copied from interface:Device
Enables CoaP communication with Device. Method should create tree ofResource
endpoints and register them to CoaP Server. Each distinct Device (e.g. Sensor, Actuator ... ) should define Resource tree.- Specified by:
startCoapController
in interfaceDevice
-
stopCoapController
public void stopCoapController()
Description copied from interface:Device
Remove allResource
endpoints for Device from CoaP Server, in order to deny CoaP communication with instance of Device.- Specified by:
stopCoapController
in interfaceDevice
-
getDataObservable
public DataObservable getDataObservable()
Description copied from interface:Device
Returns DataObservable for Device- Specified by:
getDataObservable
in interfaceDevice
- Returns:
- instance of DataObservable
-
setDataObservable
public void setDataObservable(DataObservable dataObservable)
Description copied from interface:Device
Sets DataObservable for Device.- Specified by:
setDataObservable
in interfaceDevice
- Parameters:
dataObservable
- instance of DataObservable
-
setNetworkAdapter
public void setNetworkAdapter(NetworkAdapter networkAdapter)
Description copied from interface:Device
Sets Network Adapter for device which enables sending data wi- Specified by:
setNetworkAdapter
in interfaceDevice
- Parameters:
networkAdapter
- instance of NetworkAdapter
-
getNetworkAdapter
public NetworkAdapter getNetworkAdapter()
Description copied from interface:Device
Returns NetworkAdapter assigned to Device- Specified by:
getNetworkAdapter
in interfaceDevice
- Returns:
- instance of Network Adapter
-
getCoapController
public CoapController getCoapController()
Description copied from interface:Device
Returns CoapController for Device- Specified by:
getCoapController
in interfaceDevice
- Returns:
- instacne of CoapController
-
setCoapController
public void setCoapController(CoapController coapController)
Description copied from interface:Device
Sets CoapController for Device- Specified by:
setCoapController
in interfaceDevice
- Parameters:
coapController
- instance of CoapController
-
-