Interface Device
-
- All Superinterfaces:
Unit
- All Known Subinterfaces:
Actuator
,Sensor
,SimpleSensor
- All Known Implementing Classes:
AbstractActuator
,AbstractDevice
,AbstractSensor
,AbstractSimpleSensor
,BinaryActuator
,Default
,DHT11
,Hygrometer
,LinearActuator
,RotaryActuator
,Thermometer
public interface Device extends Unit
Base interface describing concept for device. Provides methods for manipulation and configuration. User should not use this interface for creating device objects. Mainly serves for internal object interaction, but lacks DataFeed manipulation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoapController
getCoapController()
Returns CoapController for DeviceDataObservable
getDataObservable()
Returns DataObservable for DeviceNetworkAdapter
getNetworkAdapter()
Returns NetworkAdapter assigned to DeviceList<Data>
requestData(Object... params)
Pulls data from data feed.void
setCoapController(CoapController coapController)
Sets CoapController for Devicevoid
setDataObservable(DataObservable dataObservable)
Sets DataObservable for Device.void
setNetworkAdapter(NetworkAdapter networkAdapter)
Sets Network Adapter for device which enables sending data wivoid
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.
-
-
-
Method Detail
-
requestData
List<Data> requestData(Object... params)
Pulls data from data feed. This method serves as handler for data from DataFeed. Forwards parameters for getNextValue method (see DataFeed.getNextValue).- Parameters:
params
- for DataFeed computing- Returns:
- a list of generated values
-
startCoapController
void startCoapController()
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.
-
stopCoapController
void stopCoapController()
Remove allResource
endpoints for Device from CoaP Server, in order to deny CoaP communication with instance of Device.
-
setNetworkAdapter
void setNetworkAdapter(NetworkAdapter networkAdapter)
Sets Network Adapter for device which enables sending data wi- Parameters:
networkAdapter
- instance of NetworkAdapter
-
getNetworkAdapter
NetworkAdapter getNetworkAdapter()
Returns NetworkAdapter assigned to Device- Returns:
- instance of Network Adapter
-
getDataObservable
DataObservable getDataObservable()
Returns DataObservable for Device- Returns:
- instance of DataObservable
-
setDataObservable
void setDataObservable(DataObservable dataObservable)
Sets DataObservable for Device.- Parameters:
dataObservable
- instance of DataObservable
-
getCoapController
CoapController getCoapController()
Returns CoapController for Device- Returns:
- instacne of CoapController
-
setCoapController
void setCoapController(CoapController coapController)
Sets CoapController for Device- Parameters:
coapController
- instance of CoapController
-
-