Package org.openwebnet4j.communication
Class USBConnector
- java.lang.Object
- 
- org.openwebnet4j.communication.OpenConnector
- 
- org.openwebnet4j.communication.USBConnector
 
 
- 
- All Implemented Interfaces:
- gnu.io.SerialPortEventListener,- EventListener
 
 public class USBConnector extends OpenConnector implements gnu.io.SerialPortEventListener Class for communicating with a ZigBee USB Gateway using the OpenWebNet protocol- Author:
- M. Valla - Initial contribution
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.openwebnet4j.communication.OpenConnectorOpenConnector.OWNReceiveThread
 
- 
 - 
Field Summary- 
Fields inherited from class org.openwebnet4j.communication.OpenConnectorcmdChannel, isCmdConnected, isMonConnected, lastCmdFrameSentTs, listener, monChannel, monRcvThread, notifierExecutor, OWN_MAX_DATA
 
- 
 - 
Constructor SummaryConstructors Constructor Description USBConnector(String portName)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Disconnects both MON and CMD connections and stops MON receive threadStringgetFirmwareVersion()Returns the firmware version for the connector (e.g.voidopenCmdConn()Opens command (CMD) connectionvoidopenMonConn()Opens monitor (MON) connectionprotected voidprocessFrame(String newFrame)Process a frame string receivedprotected ResponsesendCommandSynchInternal(String frame)voidserialEvent(gnu.io.SerialPortEvent event)- 
Methods inherited from class org.openwebnet4j.communication.OpenConnectordisconnectCmdChannel, disconnectMonChannel, getLastCmdFrameSentTs, handleMonDisconnect, isCmdConnected, isMonConnected, notifyListener, sendCommandSynch, setListener
 
- 
 
- 
- 
- 
Constructor Detail- 
USBConnectorpublic USBConnector(String portName) 
 
- 
 - 
Method Detail- 
openCmdConnpublic void openCmdConn() throws OWNExceptionDescription copied from class:OpenConnectorOpens command (CMD) connection- Specified by:
- openCmdConnin class- OpenConnector
- Throws:
- OWNException- in case of error
 
 - 
openMonConnpublic void openMonConn() throws OWNExceptionDescription copied from class:OpenConnectorOpens monitor (MON) connection- Specified by:
- openMonConnin class- OpenConnector
- Throws:
- OWNException- in case of error
 
 - 
getFirmwareVersionpublic String getFirmwareVersion() Returns the firmware version for the connector (e.g. 1.2.3)- Returns:
- String containing firmware version, null if unknown
 
 - 
sendCommandSynchInternalprotected Response sendCommandSynchInternal(String frame) throws IOException, FrameException - Specified by:
- sendCommandSynchInternalin class- OpenConnector
- Throws:
- IOException
- FrameException
 
 - 
processFrameprotected void processFrame(String newFrame) Description copied from class:OpenConnectorProcess a frame string received- Specified by:
- processFramein class- OpenConnector
- Parameters:
- newFrame- the new frame received
 
 - 
serialEventpublic void serialEvent(gnu.io.SerialPortEvent event) - Specified by:
- serialEventin interface- gnu.io.SerialPortEventListener
 
 - 
disconnectpublic void disconnect() Description copied from class:OpenConnectorDisconnects both MON and CMD connections and stops MON receive thread- Overrides:
- disconnectin class- OpenConnector
 
 
- 
 
-