Class SerialSession
java.lang.Object
com.marginallyclever.communications.session.SessionLayer
com.marginallyclever.communications.transport.serial.SerialSession
- All Implemented Interfaces:
jssc.SerialPortEventListener
Encapsulate all serial receive/transmit at the session layer of the OSI model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetName()booleanisOpen()voidopenConnection(String portName) Open a serial connection to a device.voidvoidsendMessage(String msg) voidserialEvent(jssc.SerialPortEvent events) Methods inherited from class com.marginallyclever.communications.session.SessionLayer
addListener, removeListener
-
Constructor Details
-
SerialSession
-
-
Method Details
-
closeConnection
public void closeConnection()- Specified by:
closeConnectionin classSessionLayer
-
openConnection
Open a serial connection to a device. Has no idea to whom we are opening.- Specified by:
openConnectionin classSessionLayer- Throws:
Exception
-
serialEvent
public void serialEvent(jssc.SerialPortEvent events) - Specified by:
serialEventin interfacejssc.SerialPortEventListener
-
sendMessage
- Specified by:
sendMessagein classSessionLayer- Throws:
Exception
-
reconnect
- Specified by:
reconnectin classSessionLayer- Throws:
Exception
-
isOpen
public boolean isOpen()- Specified by:
isOpenin classSessionLayer- Returns:
- the port open for this serial connection.
-
getName
- Specified by:
getNamein classSessionLayer
-
getTransportLayer
- Specified by:
getTransportLayerin classSessionLayer
-