org.universAAL.lddi.exporter.activityhub.driver
Class Iso11073SwitchSensorInstance

Package class diagram package Iso11073SwitchSensorInstance
java.lang.Object
  extended by org.universAAL.lddi.lib.activityhub.driver.interfaces.ActivityHubDriver
      extended by org.universAAL.lddi.exporter.activityhub.driver.Iso11073SwitchSensorInstance
All Implemented Interfaces:
org.osgi.service.device.Constants, org.osgi.util.tracker.ServiceTrackerCustomizer, ActivityHubBaseDeviceCategory, Iso11073SwitchSensor

public class Iso11073SwitchSensorInstance
extends ActivityHubDriver
implements Iso11073SwitchSensor, org.osgi.util.tracker.ServiceTrackerCustomizer, org.osgi.service.device.Constants

Working instance of the ActivityHub SwitchSensor driver. Tracks on the SwitchSensor device service passed in the attach method in Iso11073SwitchSensorDriver class. This instance is passed to the consuming client (e.g. uAAL exporter bundle). When the SwitchSensor device service disappears, this driver is removed from the consuming client and from the device.

Author:
Thomas Fuxreiter (foex@gmx.at)

Field Summary
 
Fields inherited from class org.universAAL.lddi.lib.activityhub.driver.interfaces.ActivityHubDriver
client, device
 
Fields inherited from interface org.universAAL.lddi.lib.activityhub.devicecategory.Iso11073SwitchSensor
MY_DEVICE_CATEGORY
 
Fields inherited from interface org.universAAL.lddi.lib.activityhub.devicecategory.ActivityHubBaseDeviceCategory
CLASS, MANUFACTURER, MATCH_CLASS, MATCH_MAKE, MATCH_MODEL, MATCH_SERIAL, MATCH_VERSION, MODEL, REVISION, SERIAL
 
Fields inherited from interface org.osgi.service.device.Constants
DEVICE_CATEGORY, DEVICE_DESCRIPTION, DEVICE_SERIAL, DRIVER_ID
 
Constructor Summary
Iso11073SwitchSensorInstance(org.osgi.framework.BundleContext c, ActivityHubDriverClient client, org.osgi.service.log.LogService log)
           
 
Method Summary
 Object addingService(org.osgi.framework.ServiceReference reference)
           
 int getLastSensorEvent()
           
 void incomingSensorEvent(int event)
          The specific drivers have to implement this method to receive messages from devices
 void modifiedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void removedService(org.osgi.framework.ServiceReference reference, Object service)
           
 
Methods inherited from class org.universAAL.lddi.lib.activityhub.driver.interfaces.ActivityHubDriver
attachDriver, detachDriver, getDevice, removeDriver, setDevice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iso11073SwitchSensorInstance

public Iso11073SwitchSensorInstance(org.osgi.framework.BundleContext c,
                                    ActivityHubDriverClient client,
                                    org.osgi.service.log.LogService log)
Parameters:
c - OSGi BundleContext
sr - Service reference of ISO device
client - Link to consumer of this driver (e.g. uAAL exporter bundle)
Method Detail

addingService

public Object addingService(org.osgi.framework.ServiceReference reference)
Specified by:
addingService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

modifiedService

public void modifiedService(org.osgi.framework.ServiceReference reference,
                            Object service)
Specified by:
modifiedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

removedService

public void removedService(org.osgi.framework.ServiceReference reference,
                           Object service)
Specified by:
removedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

getLastSensorEvent

public int getLastSensorEvent()
Specified by:
getLastSensorEvent in class ActivityHubDriver
Returns:
last incoming sensor event

incomingSensorEvent

public void incomingSensorEvent(int event)
Description copied from interface: ActivityHubBaseDeviceCategory
The specific drivers have to implement this method to receive messages from devices

Specified by:
incomingSensorEvent in interface ActivityHubBaseDeviceCategory
Parameters:
event - Integer representation of a specific ActivityHubSensorEvent. example MotionSensor: motion-detected = 0; no-condition-detected = 3


Copyright © 2014 universAAL Consortium. All Rights Reserved.