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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getName()
boolean
isOpen()
void
openConnection
(String ipAddress) Open a connection to a device on the net.void
void
reportDataReceived
(String msg) void
reportDataSent
(String msg) void
run()
void
sendMessage
(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:
openConnection
in classSessionLayer
- Parameters:
ipAddress
- the network address of the device- Throws:
Exception
-
closeConnection
public void closeConnection()- Specified by:
closeConnection
in classSessionLayer
-
run
public void run() -
sendMessage
- Specified by:
sendMessage
in classSessionLayer
- Throws:
Exception
-
reportDataSent
-
reportDataReceived
-
reconnect
- Specified by:
reconnect
in classSessionLayer
- Throws:
Exception
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in classSessionLayer
- Returns:
- the port open for this connection.
-
getName
- Specified by:
getName
in classSessionLayer
-
getTransportLayer
- Specified by:
getTransportLayer
in classSessionLayer
-