public abstract class ActivityHubSensor extends Object implements org.osgi.service.device.Device
Modifier and Type | Field and Description |
---|---|
protected ActivityHubBaseDeviceCategory |
driver
reference to my driver instance; can be just one!
|
protected Object |
lastSensorEvent
all inherited classes must use the same member name, even though they
have different types
|
Constructor and Description |
---|
ActivityHubSensor(ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory deviceCategory,
ActivityHubLocationUtil.ActivityHubLocation deviceLocation,
String deviceId,
org.osgi.service.log.LogService logger)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDriver(ActivityHubBaseDeviceCategory driverInstance)
store a driver reference for this device
|
ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory |
getDeviceCategory() |
String |
getDeviceId() |
ActivityHubLocationUtil.ActivityHubLocation |
getDeviceLocation() |
abstract int |
getSensorEventValue() |
void |
noDriverFound() |
void |
removeDriver()
remove the driver reference of this device
|
protected void |
sendEvent(int event)
send sensor event to driver (upper layer)
|
abstract void |
setSensorEventOff()
set sensor event to off (e.g.
|
abstract void |
setSensorEventOn()
set sensor event to on (e.g.
|
protected Object lastSensorEvent
protected ActivityHubBaseDeviceCategory driver
public ActivityHubSensor(ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory deviceCategory, ActivityHubLocationUtil.ActivityHubLocation deviceLocation, String deviceId, org.osgi.service.log.LogService logger)
deviceCategory
- deviceLocation
- deviceId
- logger
- public void addDriver(ActivityHubBaseDeviceCategory driverInstance)
public void removeDriver()
public abstract void setSensorEventOn()
public abstract void setSensorEventOff()
protected void sendEvent(int event)
public abstract int getSensorEventValue()
public ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory getDeviceCategory()
public ActivityHubLocationUtil.ActivityHubLocation getDeviceLocation()
public String getDeviceId()
public void noDriverFound()
noDriverFound
in interface org.osgi.service.device.Device
Copyright © 2018 universAAL Consortium. All rights reserved.