org.universAAL.lddi.knx.driver
Class KnxDpt1Instance
java.lang.Object
org.universAAL.lddi.knx.interfaces.KnxDriver
org.universAAL.lddi.knx.driver.KnxDpt1Instance
- All Implemented Interfaces:
- org.osgi.service.device.Constants, org.osgi.util.tracker.ServiceTrackerCustomizer, IKnxDpt1, IKnxReceiveMessage
public class KnxDpt1Instance
- extends KnxDriver
- implements IKnxDpt1, IKnxReceiveMessage, org.osgi.util.tracker.ServiceTrackerCustomizer, org.osgi.service.device.Constants
Working instance of the IKnxDpt1 driver. Registers a service/device in OSGi registry.
Tracks on the KNX groupDevice service passed in the attach method in KnxDpt1Driver class.
This instance is passed to the consuming client (e.g. uAAL exporter bundle).
When the KNX groupDevice service disappears, this driver is removed from the consuming
client and from the groupDevice.
This driver handles knx 1-bit events (knx datapoint 1), which is on/off.
- Author:
- Thomas Fuxreiter (foex@gmx.at)
Fields inherited from interface org.universAAL.lddi.knx.groupdevicecategory.IKnxDpt1 |
CLASS, DEFAULT_VALUE_OFF, DEFAULT_VALUE_ON, MANUFACTURER, MATCH_CLASS, MATCH_MAKE, MATCH_MODEL, MATCH_SERIAL, MATCH_VERSION, MODEL, MY_DEVICE_CATEGORY, REVISION, SERIAL |
Fields inherited from interface org.osgi.service.device.Constants |
DEVICE_CATEGORY, DEVICE_DESCRIPTION, DEVICE_SERIAL, DRIVER_ID |
Method Summary |
Object |
addingService(org.osgi.framework.ServiceReference reference)
track on my groupDevice |
void |
modifiedService(org.osgi.framework.ServiceReference reference,
Object service)
|
void |
newMessageFromKnxBus(byte[] event)
Calculate readable measurement value (boolean) from given byte array according to KNX DPT 1. |
void |
removedService(org.osgi.framework.ServiceReference reference,
Object service)
|
void |
sendMessageToKnxBus(boolean event)
Transfer boolean event to KNX byte array (payload). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KnxDpt1Instance
public KnxDpt1Instance(KnxDpt1Driver parent_)
- Parameters:
c
- OSGi BundleContextsr
- Service reference of KNX groupDeviceclient
- Link to consumer of this driver (e.g. uAAL exporter bundle)
addingService
public Object addingService(org.osgi.framework.ServiceReference reference)
- track on my groupDevice
- Specified by:
addingService
in interface org.osgi.util.tracker.ServiceTrackerCustomizer
- Parameters:
IKnxDpt1
- groupDevice service
- Returns:
- The service object to be tracked for the ServiceReference object or null if the ServiceReference object should not be tracked.
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
newMessageFromKnxBus
public void newMessageFromKnxBus(byte[] event)
- Calculate readable measurement value (boolean) from given byte array according to KNX DPT 1.
Call client.
- Specified by:
newMessageFromKnxBus
in interface IKnxReceiveMessage
- Parameters:
event
- the status/event byte of the knx telegram- See Also:
IKnxReceiveMessage.newMessageFromKnxBus(byte[])
sendMessageToKnxBus
public void sendMessageToKnxBus(boolean event)
- Transfer boolean event to KNX byte array (payload).
Call driver.
Copyright © 2014 universAAL Consortium. All Rights Reserved.