Class TCPSession
java.lang.Object
com.marginallyclever.communications.session.SessionLayer
com.marginallyclever.communications.transport.tcp.TCPSession
- All Implemented Interfaces:
Runnable
SSH TCP/IP connection to a Raspberry Pi and then open a picocom session to /dev/ttyACM0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetName()booleanisOpen()voidopenConnection(String ipAddress) Open a connection to a device on the net.voidvoidreportDataReceived(String msg) voidreportDataSent(String msg) voidrun()voidsendMessage(String msg) Methods inherited from class com.marginallyclever.communications.session.SessionLayer
addListener, removeListener
-
Constructor Details
-
TCPSession
-
-
Method Details
-
openConnection
Open a connection to a device on the net. The ipAddress format is a normal URI - name:password@ipaddress:port- Specified by:
openConnectionin classSessionLayer- Parameters:
ipAddress- the network address of the device- Throws:
Exception
-
closeConnection
public void closeConnection()- Specified by:
closeConnectionin classSessionLayer
-
run
-
sendMessage
- Specified by:
sendMessagein classSessionLayer- Throws:
Exception
-
reportDataSent
-
reportDataReceived
-
reconnect
- Specified by:
reconnectin classSessionLayer- Throws:
Exception
-
isOpen
public boolean isOpen()- Specified by:
isOpenin classSessionLayer- Returns:
- the port open for this connection.
-
getName
- Specified by:
getNamein classSessionLayer
-
getTransportLayer
- Specified by:
getTransportLayerin classSessionLayer
-