org.universAAL.lddi.lib.activityhub.devicemodel
Class ActivityHubSensor

Package class diagram package ActivityHubSensor
java.lang.Object
  extended by org.universAAL.lddi.lib.activityhub.devicemodel.ActivityHubSensor
All Implemented Interfaces:
org.osgi.service.device.Device
Direct Known Subclasses:
ContactClosureSensor, FallSensor, MotionSensor, SwitchSensor, TemperatureSensor, UsageSensor

public abstract class ActivityHubSensor
extends Object
implements org.osgi.service.device.Device

Activity hub sensor base class Now all ActivityHub sensors are implemented as on/off sensors having setSensorEventOn and setSensorEventOff methods. TODO: check if it's possible/better to use any value setSensorEvent(int sensorEvent); for KNX datapoint type 1.*** (which are used mainly during development) on/off is sufficient Generic sensor properties flags for activity hub sensors are not implement yet! (Because they are not supported by KNX sensors) auto-presence-received(16) (For sensors that have "heartbeat" operational status: indicates that the "heartbeat" has been seen and is ok. This flag shall be reset if Auto-Presence-Failed is set.) auto-presence-failed(17) (For sensors that have "heartbeat" operational status: indicates that the "heartbeat" has not been seen as expected. This flag shall be reset if Auto-Presence-Received is set.) low-battery(18) (Indicates the sensor is in the low battery condition. This determination is unique to the sensor.) fault(19) (Indicates that the sensor is in a fault condition and needs attention. This determination is unique to the sensor.) end-of-life(20) (Indicates that the sensor has reached end of life and needs replacement. This indication is unique to the sensor.)

Author:
Thomas Fuxreiter (foex@gmx.at)

Field Summary
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
 
Fields inherited from interface org.osgi.service.device.Device
MATCH_NONE
 
Constructor Summary
ActivityHubSensor(ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory deviceCategory, ActivityHubLocationUtil.ActivityHubLocation deviceLocation, String deviceId, org.osgi.service.log.LogService logger)
          Constructor
 
Method Summary
 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. switch-off) if input comes from an 1-bit sensor
abstract  void setSensorEventOn()
          set sensor event to on (e.g. switch-on) if input comes from an 1-bit sensor called by refinement driver is on/off feasible for all ActivityHubSensors?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastSensorEvent

protected Object lastSensorEvent
all inherited classes must use the same member name, even though they have different types


driver

protected ActivityHubBaseDeviceCategory driver
reference to my driver instance; can be just one!

Constructor Detail

ActivityHubSensor

public ActivityHubSensor(ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory deviceCategory,
                         ActivityHubLocationUtil.ActivityHubLocation deviceLocation,
                         String deviceId,
                         org.osgi.service.log.LogService logger)
Constructor

Parameters:
deviceCategory -
deviceLocation -
deviceId -
logger -
Method Detail

addDriver

public void addDriver(ActivityHubBaseDeviceCategory driverInstance)
store a driver reference for this device


removeDriver

public void removeDriver()
remove the driver reference of this device


setSensorEventOn

public abstract void setSensorEventOn()
set sensor event to on (e.g. switch-on) if input comes from an 1-bit sensor called by refinement driver is on/off feasible for all ActivityHubSensors?


setSensorEventOff

public abstract void setSensorEventOff()
set sensor event to off (e.g. switch-off) if input comes from an 1-bit sensor


sendEvent

protected void sendEvent(int event)
send sensor event to driver (upper layer)


getSensorEventValue

public abstract int getSensorEventValue()
Returns:
the sensorEvent

getDeviceCategory

public ActivityHubDeviceCategoryUtil.ActivityHubDeviceCategory getDeviceCategory()
Returns:
the deviceCategory

getDeviceLocation

public ActivityHubLocationUtil.ActivityHubLocation getDeviceLocation()
Returns:
the deviceLocation

getDeviceId

public String getDeviceId()
Returns:
the deviceId

noDriverFound

public void noDriverFound()
Specified by:
noDriverFound in interface org.osgi.service.device.Device


Copyright © 2014 universAAL Consortium. All Rights Reserved.