org.universAAL.lddi.knx.networkdriver
Class KnxNetworkDriverImp

Package class diagram package KnxNetworkDriverImp
java.lang.Object
  extended by org.universAAL.lddi.knx.networkdriver.KnxNetworkDriverImp
All Implemented Interfaces:
org.osgi.service.cm.ManagedService, IKnxNetwork

public final class KnxNetworkDriverImp
extends Object
implements org.osgi.service.cm.ManagedService, IKnxNetwork

KnxNetworkDriverImp is the main class of this bundle. It registers as a service in the OSGi framework with the name org.universAAL.lddi.knx.networkdriver.test.KnxNetwork. It manages a list of KNX devices (injected by knx.devicemanager) where the KNX group address is used as key. Incoming sensor events are passed on to the appropriate KNX groupDevice (identified by KNX group address).

Author:
Thomas Fuxreiter (foex@gmx.at)

Field Summary
 org.osgi.framework.ServiceRegistration regServiceKnx
           
 
Fields inherited from interface org.universAAL.lddi.knx.interfaces.IKnxNetwork
COMMAND_NAME, COMMAND_VALUE, DAFAULT_READ_CHAR, DAFAULT_STATUS_CHAR, GROUP_ADDRESS, MANUFACTURER, TIME
 
Constructor Summary
KnxNetworkDriverImp(org.osgi.framework.BundleContext context, org.osgi.service.log.LogService log)
          Class constructor
 
Method Summary
 void addGroupDevice(String deviceId, KnxGroupDevice device)
          Devices can register here to get events from the knx bus
 String getKnxGatewayIp()
           
 int getKnxGatewayPort()
           
 org.osgi.service.log.LogService getLogger()
           
 String getMulticastIp()
           
 int getMulticastUdpPort()
           
 String getMyIp()
           
 int getMyPort()
           
 boolean isMulticast()
           
 void networkConnected()
           
 void networkDisconnected()
           
 void newMessageFromHouse(String groupAddress, byte[] event)
          Forward the message from the house to the groupDevice; mapping on groupAddress
 void removeGroupDevice(String deviceId, KnxGroupDevice device)
          Devices can unregister here to stop getting events from the knx bus
 void requestState(String deviceId)
           
 void sendCommand(String deviceId, boolean command)
           
 void sendCommand(String device, boolean command, KnxCommand commandType)
           
 void sendMessageToKnxBus(String groupDeviceId, byte[] event)
          Sending KNX message to KNX bus.
 void setKnxGatewayIp(String knxGatewayIp)
           
 void setKnxGatewayPort(int knxGatewayPort)
           
 void setMulticast(boolean multicast)
           
 void setMulticastIp(String multicastIp)
           
 void setMulticastUdpPort(int multicastUdpPort)
           
 void setMyIp(String myIp)
           
 void setMyPort(int myPort)
           
 void unRegister()
           
 void updated(Dictionary settings)
          Update from OSGi Configuration Manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regServiceKnx

public org.osgi.framework.ServiceRegistration regServiceKnx
Constructor Detail

KnxNetworkDriverImp

public KnxNetworkDriverImp(org.osgi.framework.BundleContext context,
                           org.osgi.service.log.LogService log)
Class constructor

Parameters:
context - OSGi framework
log -
Method Detail

updated

public void updated(Dictionary settings)
             throws org.osgi.service.cm.ConfigurationException
Update from OSGi Configuration Manager

Specified by:
updated in interface org.osgi.service.cm.ManagedService
Throws:
org.osgi.service.cm.ConfigurationException

networkConnected

public void networkConnected()

networkDisconnected

public void networkDisconnected()

getLogger

public org.osgi.service.log.LogService getLogger()

unRegister

public void unRegister()

addGroupDevice

public void addGroupDevice(String deviceId,
                           KnxGroupDevice device)
Devices can register here to get events from the knx bus

Specified by:
addGroupDevice in interface IKnxNetwork

removeGroupDevice

public void removeGroupDevice(String deviceId,
                              KnxGroupDevice device)
Devices can unregister here to stop getting events from the knx bus

Specified by:
removeGroupDevice in interface IKnxNetwork

newMessageFromHouse

public void newMessageFromHouse(String groupAddress,
                                byte[] event)
Forward the message from the house to the groupDevice; mapping on groupAddress

Parameters:
groupAddress - the knx groupAddress
b - knx command/status bytes (representing e.g. on, off)

sendMessageToKnxBus

public void sendMessageToKnxBus(String groupDeviceId,
                                byte[] event)
Sending KNX message to KNX bus.

Specified by:
sendMessageToKnxBus in interface IKnxNetwork
Parameters:
groupDeviceId - KNX group address (e.g. 1/2/3)
event - payload starting with apci/data byte!

sendCommand

public void sendCommand(String deviceId,
                        boolean command)
Specified by:
sendCommand in interface IKnxNetwork

sendCommand

public void sendCommand(String device,
                        boolean command,
                        KnxCommand commandType)
Specified by:
sendCommand in interface IKnxNetwork

requestState

public void requestState(String deviceId)
Specified by:
requestState in interface IKnxNetwork

isMulticast

public boolean isMulticast()
Returns:
the multicast

setMulticast

public void setMulticast(boolean multicast)
Parameters:
multicast - the multicast to set

setKnxGatewayIp

public void setKnxGatewayIp(String knxGatewayIp)
Parameters:
knxGatewayIp - the knxGatewayIp to set

getKnxGatewayIp

public String getKnxGatewayIp()
Returns:
the knxGatewayIp

setKnxGatewayPort

public void setKnxGatewayPort(int knxGatewayPort)
Parameters:
knxGatewayPort - the knxGatewayPort to set

getKnxGatewayPort

public int getKnxGatewayPort()
Returns:
the knxGatewayPort

setMyIp

public void setMyIp(String myIp)
Parameters:
myIp - the myIp to set

getMyIp

public String getMyIp()
Returns:
the myIp

getMyPort

public int getMyPort()
Returns:
the myPort

setMyPort

public void setMyPort(int myPort)
Parameters:
myPort - the myPort to set

getMulticastIp

public String getMulticastIp()

setMulticastIp

public void setMulticastIp(String multicastIp)
Parameters:
multicastIp - the multicastIp to set

getMulticastUdpPort

public int getMulticastUdpPort()
Returns:
the multicastUdpPort

setMulticastUdpPort

public void setMulticastUdpPort(int multicastUdpPort)
Parameters:
multicastUdpPort - the multicastUdpPort to set


Copyright © 2014 universAAL Consortium. All Rights Reserved.