Package org.openwebnet4j
Class USBGateway
- java.lang.Object
-
- org.openwebnet4j.OpenGateway
-
- org.openwebnet4j.USBGateway
-
- All Implemented Interfaces:
ConnectorListener
public class USBGateway extends OpenGateway
ClassUSBGatewayto connect to ZigBee USB Gateways usingUSBConnector- Author:
- M. Valla - Initial contribution
-
-
Field Summary
-
Fields inherited from class org.openwebnet4j.OpenGateway
connector, isConnected, isDiscovering, listeners, macAddr
-
-
Constructor Summary
Constructors Constructor Description USBGateway(String serialPortName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddiscoverDevicesInternal()StringgetSerialPortName()Returns the gateway serial port nameintgetZigBeeIdAsDecimal()Returns the ZigBee ID of the gateway in decimal format (=four last bytes of the ZigBee MAC address of the product converted in decimal format).protected voidinitConnector()Init the connector for this OpenGateway.booleanisCmdConnectionReady()Returns true if CMD connection is ready to send messages (connector must be connected and in case of BUS connection checks if a CMD was sent recently < 120sec)voidonMessage(OpenMessage message)This method is called when a newOpenMessageis received by the OpenConnector MONITOR connectionStringtoString()-
Methods inherited from class org.openwebnet4j.OpenGateway
closeConnection, connect, discoverDevices, getFirmwareVersion, getMACAddr, isConnected, isDiscovering, notifyListeners, onMonDisconnected, reconnect, send, sendHighPriority, sendInternal, subscribe, unsubscribe
-
-
-
-
Constructor Detail
-
USBGateway
public USBGateway(String serialPortName)
-
-
Method Detail
-
getSerialPortName
public String getSerialPortName()
Returns the gateway serial port name- Returns:
- serial port
-
initConnector
protected void initConnector()
Description copied from class:OpenGatewayInit the connector for this OpenGateway.- Specified by:
initConnectorin classOpenGateway
-
discoverDevicesInternal
protected void discoverDevicesInternal()
- Specified by:
discoverDevicesInternalin classOpenGateway
-
onMessage
public void onMessage(OpenMessage message)
Description copied from interface:ConnectorListenerThis method is called when a newOpenMessageis received by the OpenConnector MONITOR connection- Specified by:
onMessagein interfaceConnectorListener- Overrides:
onMessagein classOpenGateway- Parameters:
message- theOpenMessagereceived
-
getZigBeeIdAsDecimal
public int getZigBeeIdAsDecimal()
Returns the ZigBee ID of the gateway in decimal format (=four last bytes of the ZigBee MAC address of the product converted in decimal format).- Returns:
- the gateway ZigBeeId, or 0 if it is unknown
-
isCmdConnectionReady
public boolean isCmdConnectionReady()
Description copied from class:OpenGatewayReturns true if CMD connection is ready to send messages (connector must be connected and in case of BUS connection checks if a CMD was sent recently < 120sec)- Specified by:
isCmdConnectionReadyin classOpenGateway- Returns:
- boolean
-
-