public class AwidGPIOSession extends AbstractPubSubIPSensorSession implements IPSessionEndpoint
Constructor and Description |
---|
AwidGPIOSession(AbstractSensor<?> sensor,
java.lang.String ID,
java.lang.String host,
int port)
Create a new session for interacting with the AWID reader's GPIO module
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Close the connection and stop processing of commands.
|
void |
flashOutput(java.util.BitSet ports,
java.util.BitSet finalPorts,
int timeOn,
int timeOff,
int repeat) |
void |
handleMessage(ByteMessage message)
Called when a new message has been received.
|
ByteMessage |
receiveMessage(long timeout)
Receive a message.
|
void |
sendMessage(AbstractAwidCommand message) |
void |
setOutputPort(java.util.BitSet ports) |
boolean |
testInputPort(int port) |
java.lang.String |
toString() |
subscribe, unsubscribe
getHost, getPort
getCommandInstance, getStatus, killComand, submit, submit, submit, submitAndBlock, suspendCommand
connect, getCommands, getDTO, getID, getSensor, getTimeout, handleTimeout, killAllCommands, restoreCommands
public AwidGPIOSession(AbstractSensor<?> sensor, java.lang.String ID, java.lang.String host, int port)
sensor
- ID
- host
- port
- public void setOutputPort(java.util.BitSet ports) throws CannotExecuteException
ports
- CannotExecuteException
public boolean testInputPort(int port) throws CannotExecuteException
port
- CannotExecuteException
public void flashOutput(java.util.BitSet ports, java.util.BitSet finalPorts, int timeOn, int timeOff, int repeat) throws CannotExecuteException
ports
- finalPorts
- timeOn
- timeOff
- repeat
- CannotExecuteException
public void sendMessage(AbstractAwidCommand message) throws java.io.IOException
java.io.IOException
public void disconnect()
SensorSession
disconnect
in class AbstractIPSensorSession
public void handleMessage(ByteMessage message)
IPSessionEndpoint
handleMessage
in interface IPSessionEndpoint
message
- - the new message.public ByteMessage receiveMessage(long timeout) throws java.io.IOException
timeout
- in miliseconsjava.io.IOException
- If there was a problem recieving the message or if a Timeout
happened.public java.lang.String toString()
toString
in class AbstractIPSensorSession