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 String
CMD_SESSION
static String
CMD_SESSION_ALT
static String
CMD_TYPE
static int
HANDSHAKE_TIMEOUT
static String
HMAC_SHA1
static String
HMAC_SHA2
static int
MON_KEEPALIVE_TIMER
static String
MON_SESSION
static String
MON_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 void
disconnect()
Disconnects both MON and CMD connections and stops MON receive threadprotected void
handleMonDisconnect(OWNException e)
Called when MON connection is disconnectedvoid
openCmdConn()
Opens command (CMD) connectionvoid
openMonConn()
Opens monitor (MON) connectionprotected void
processFrame(String newFrame)
Process a frame string receivedprotected Response
sendCommandSynchInternal(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 OWNException
Description copied from class:OpenConnector
Opens command (CMD) connection- Specified by:
openCmdConn
in classOpenConnector
- Throws:
OWNException
- in case of error
-
openMonConn
public void openMonConn() throws OWNException
Description copied from class:OpenConnector
Opens monitor (MON) connection- Specified by:
openMonConn
in classOpenConnector
- Throws:
OWNException
- in case of error
-
sendCommandSynchInternal
protected Response sendCommandSynchInternal(String frame) throws IOException, FrameException
- Specified by:
sendCommandSynchInternal
in classOpenConnector
- Throws:
IOException
FrameException
-
processFrame
protected void processFrame(String newFrame)
Description copied from class:OpenConnector
Process a frame string received- Specified by:
processFrame
in classOpenConnector
- Parameters:
newFrame
- the new frame received
-
handleMonDisconnect
protected void handleMonDisconnect(OWNException e)
Description copied from class:OpenConnector
Called when MON connection is disconnected- Overrides:
handleMonDisconnect
in classOpenConnector
- Parameters:
e
- the {link OWNException} received when disconnected
-
disconnect
public void disconnect()
Description copied from class:OpenConnector
Disconnects both MON and CMD connections and stops MON receive thread- Overrides:
disconnect
in classOpenConnector
-
-