org.universAAL.lddi.knx.groupdevicemodel
Class KnxGroupDevice

Package class diagram package KnxGroupDevice
java.lang.Object
  extended by org.universAAL.lddi.knx.groupdevicemodel.KnxGroupDevice
All Implemented Interfaces:
org.osgi.service.device.Device, IKnxReceiveMessage, IKnxSendMessage
Direct Known Subclasses:
KnxDpt1GroupDevice, KnxDpt2GroupDevice, KnxDpt3GroupDevice, KnxDpt4GroupDevice, KnxDpt5GroupDevice, KnxDpt9GroupDevice

public abstract class KnxGroupDevice
extends Object
implements org.osgi.service.device.Device, IKnxReceiveMessage, IKnxSendMessage

One KNX group groupDevice represents one groupAddress (with additional properties) from ETS4 XML export. This groupDevice is registered in OSGi framework.

Author:
Thomas Fuxreiter (foex@gmx.at)

Field Summary
protected  IKnxReceiveMessage driver
          reference to my driver instance; can be just one!
 KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory groupDeviceCategory
          OSGi DAS properties
protected  org.osgi.service.log.LogService logger
           
protected  IKnxNetwork network
           
 
Fields inherited from interface org.osgi.service.device.Device
MATCH_NONE
 
Constructor Summary
KnxGroupDevice(KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory knxGroupDeviceCategory)
          empty constructor for factory
 
Method Summary
 void addDriver(IKnxReceiveMessage driverInstance)
          store a driver reference for this groupDevice
 String getDatapointType()
           
 int getDatapointTypeMainNumber()
          Returns 0 on error.
 int getDatapointTypeSubNumber()
          Returns 0 on error.
 String getGroupAddress()
           
 KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory getGroupDeviceCategory()
           
 String getGroupDeviceId()
           
 void newMessageFromKnxBus(byte[] event)
          Receive low level messages from the knx bus
 void noDriverFound()
           
 void removeDriver()
          remove the driver reference of this groupDevice
 void sendMessageToKnxBus(byte[] event)
          Send message to the knx bus
 void setParams(KnxGroupAddress knxGroupAddress, IKnxNetwork network, org.osgi.service.log.LogService logger)
          Fill empty groupDevice with parameters and set it alive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupDeviceCategory

public KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory groupDeviceCategory
OSGi DAS properties


logger

protected org.osgi.service.log.LogService logger

network

protected IKnxNetwork network

driver

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

Constructor Detail

KnxGroupDevice

public KnxGroupDevice(KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory knxGroupDeviceCategory)
empty constructor for factory

Method Detail

setParams

public void setParams(KnxGroupAddress knxGroupAddress,
                      IKnxNetwork network,
                      org.osgi.service.log.LogService logger)
Fill empty groupDevice with parameters and set it alive

Parameters:
knxGroupAddress -
network -
logger2 -

addDriver

public void addDriver(IKnxReceiveMessage driverInstance)
store a driver reference for this groupDevice


removeDriver

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


newMessageFromKnxBus

public void newMessageFromKnxBus(byte[] event)
Receive low level messages from the knx bus

Specified by:
newMessageFromKnxBus in interface IKnxReceiveMessage
Parameters:
event - the status/event byte of the knx telegram

sendMessageToKnxBus

public void sendMessageToKnxBus(byte[] event)
Send message to the knx bus

Specified by:
sendMessageToKnxBus in interface IKnxSendMessage
Parameters:
event - the status/event byte of the knx telegram

noDriverFound

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

getGroupAddress

public String getGroupAddress()
Returns:
knxGroupAddress as String "M/S/D"

getDatapointType

public String getDatapointType()
Returns:
knx datapoint type as String "M.mmm"

getDatapointTypeMainNumber

public int getDatapointTypeMainNumber()
Returns 0 on error. for dpt "1.018" this method will return 1

Returns:
knx datapoint main type

getDatapointTypeSubNumber

public int getDatapointTypeSubNumber()
Returns 0 on error. for dpt "1.018" this method will return 18

Returns:
knx datapoint minor type

getGroupDeviceCategory

public KnxGroupDeviceCategoryUtil.KnxGroupDeviceCategory getGroupDeviceCategory()
Returns:
groupDeviceCategory from KnxGroupDeviceCategory Enum (i.e. KNX_DPT_1)

getGroupDeviceId

public String getGroupDeviceId()
Returns:
the groupDeviceId


Copyright © 2014 universAAL Consortium. All Rights Reserved.