Package org.openwebnet4j.communication
Class BUSConnector
- java.lang.Object
 - 
- org.openwebnet4j.communication.OpenConnector
 - 
- org.openwebnet4j.communication.BUSConnector
 
 
 
- 
public class BUSConnector extends OpenConnector
Class for communicating with a BUS OpenWebNet gateway- Author:
 - M. Valla - Initial contribution
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class org.openwebnet4j.communication.OpenConnector
OpenConnector.OWNReceiveThread 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description static StringCMD_SESSIONstatic StringCMD_SESSION_ALTstatic StringCMD_TYPEstatic intHANDSHAKE_TIMEOUTstatic StringHMAC_SHA1static StringHMAC_SHA2static intMON_KEEPALIVE_TIMERstatic StringMON_SESSIONstatic StringMON_TYPE- 
Fields inherited from class org.openwebnet4j.communication.OpenConnector
cmdChannel, isCmdConnected, isMonConnected, lastCmdFrameSentTs, listener, monChannel, monRcvThread, notifierExecutor, OWN_MAX_DATA 
 - 
 
- 
Constructor Summary
Constructors Constructor Description BUSConnector(String host, int port, String pwd) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Disconnects both MON and CMD connections and stops MON receive threadprotected voidhandleMonDisconnect(OWNException e)Called when MON connection is disconnectedvoidopenCmdConn()Opens command (CMD) connectionvoidopenMonConn()Opens monitor (MON) connectionprotected voidprocessFrame(String newFrame)Process a frame string receivedprotected ResponsesendCommandSynchInternal(String frame)- 
Methods inherited from class org.openwebnet4j.communication.OpenConnector
disconnectCmdChannel, disconnectMonChannel, getLastCmdFrameSentTs, isCmdConnected, isMonConnected, notifyListener, sendCommandSynch, setListener 
 - 
 
 - 
 
- 
- 
Field Detail
- 
MON_TYPE
public static final String MON_TYPE
- See Also:
 - Constant Field Values
 
 
- 
CMD_TYPE
public static final String CMD_TYPE
- See Also:
 - Constant Field Values
 
 
- 
CMD_SESSION
public static final String CMD_SESSION
- See Also:
 - Constant Field Values
 
 
- 
CMD_SESSION_ALT
public static final String CMD_SESSION_ALT
- See Also:
 - Constant Field Values
 
 
- 
MON_SESSION
public static final String MON_SESSION
- See Also:
 - Constant Field Values
 
 
- 
MON_KEEPALIVE_TIMER
public static final int MON_KEEPALIVE_TIMER
- See Also:
 - Constant Field Values
 
 
- 
HANDSHAKE_TIMEOUT
public static final int HANDSHAKE_TIMEOUT
- See Also:
 - Constant Field Values
 
 
- 
HMAC_SHA1
public static final String HMAC_SHA1
- See Also:
 - Constant Field Values
 
 
- 
HMAC_SHA2
public static final String HMAC_SHA2
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
openCmdConn
public void openCmdConn() throws OWNExceptionDescription copied from class:OpenConnectorOpens command (CMD) connection- Specified by:
 openCmdConnin classOpenConnector- Throws:
 OWNException- in case of error
 
- 
openMonConn
public void openMonConn() throws OWNExceptionDescription copied from class:OpenConnectorOpens monitor (MON) connection- Specified by:
 openMonConnin classOpenConnector- Throws:
 OWNException- in case of error
 
- 
sendCommandSynchInternal
protected Response sendCommandSynchInternal(String frame) throws IOException, FrameException
- Specified by:
 sendCommandSynchInternalin classOpenConnector- Throws:
 IOExceptionFrameException
 
- 
processFrame
protected void processFrame(String newFrame)
Description copied from class:OpenConnectorProcess a frame string received- Specified by:
 processFramein classOpenConnector- Parameters:
 newFrame- the new frame received
 
- 
handleMonDisconnect
protected void handleMonDisconnect(OWNException e)
Description copied from class:OpenConnectorCalled when MON connection is disconnected- Overrides:
 handleMonDisconnectin classOpenConnector- Parameters:
 e- the {link OWNException} received when disconnected
 
- 
disconnect
public void disconnect()
Description copied from class:OpenConnectorDisconnects both MON and CMD connections and stops MON receive thread- Overrides:
 disconnectin classOpenConnector
 
 - 
 
 -