Package org.openwebnet4j
Class USBGateway
- java.lang.Object
-
- org.openwebnet4j.OpenGateway
-
- org.openwebnet4j.USBGateway
-
- All Implemented Interfaces:
ConnectorListener
public class USBGateway extends OpenGateway
ClassUSBGateway
to 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 void
discoverDevicesInternal()
String
getSerialPortName()
Returns the gateway serial port nameint
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).protected void
initConnector()
Init the connector for this OpenGateway.boolean
isCmdConnectionReady()
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)void
onMessage(OpenMessage message)
This method is called when a newOpenMessage
is received by the OpenConnector MONITOR connectionString
toString()
-
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:OpenGateway
Init the connector for this OpenGateway.- Specified by:
initConnector
in classOpenGateway
-
discoverDevicesInternal
protected void discoverDevicesInternal()
- Specified by:
discoverDevicesInternal
in classOpenGateway
-
onMessage
public void onMessage(OpenMessage message)
Description copied from interface:ConnectorListener
This method is called when a newOpenMessage
is received by the OpenConnector MONITOR connection- Specified by:
onMessage
in interfaceConnectorListener
- Overrides:
onMessage
in classOpenGateway
- Parameters:
message
- theOpenMessage
received
-
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:OpenGateway
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)- Specified by:
isCmdConnectionReady
in classOpenGateway
- Returns:
- boolean
-
-