public class SLState
extends java.lang.Object
Blockette
Modifier and Type | Field and Description |
---|---|
static int |
BUFSIZE
Size of receiving buffer.
|
byte[] |
databuf
Data buffer for received packets.
|
boolean |
expect_info
Flag to indicate if an INFO response is expected.
|
static int |
INFO_QUERY
INFO query state INFO_QUERY.
|
static int |
KEEP_ALIVE_QUERY
INFO query state KEEP_ALIVE_QUERY.
|
double |
keepalive_time |
int |
keepalive_trig
Send keepalive trigger.
|
double |
netdly_time
Network re-connect delay time stamp.
|
int |
netdly_trig
Network re-connect delay trigger.
|
double |
netto_time
Network timeout time stamp.
|
int |
netto_trig
Network timeout trigger.
|
static int |
NO_QUERY
INFO query state NO_QUERY.
|
double |
previous_time
Time stamp of last state update.
|
int |
query_mode
INFO query state.
|
int |
recptr
Receive pointer for databuf.
|
int |
sendptr
Send pointer for databuf.
|
static int |
SL_DATA
Connection state data.
|
static int |
SL_DOWN
Connection state down.
|
static int |
SL_UP
Connection state up.
|
int |
state
Connection state.
|
Constructor and Description |
---|
SLState()
Creates a new instance of SLState
|
Modifier and Type | Method and Description |
---|---|
void |
appendBytes(byte[] bytes)
Appends bytes to the receive buffer after the last received data.
|
int |
bytesRemaining()
Return number of bytes remaining in receiving buffer.
|
SLPacket |
getPacket()
Returns last received packet.
|
void |
incrementSendPointer()
Increments the send pointer by size of one packet.
|
boolean |
isEnd()
Check for SeedLink END packet.
|
boolean |
isError()
Check for SeedLink ERROR packet.
|
void |
packDataBuffer()
Packs the buffer by removing all sent packets and shifting remaining bytes to beginning of buffer.
|
boolean |
packetAvailable()
Check for full packet available to send.
|
boolean |
packetIsInfo()
Check for SeedLink INFO packet.
|
public static final int SL_DOWN
public static final int SL_UP
public static final int SL_DATA
public int state
public static final int NO_QUERY
public static final int INFO_QUERY
public static final int KEEP_ALIVE_QUERY
public int query_mode
public static final int BUFSIZE
public byte[] databuf
public int recptr
public int sendptr
public boolean expect_info
public int netto_trig
public int netdly_trig
public int keepalive_trig
public double previous_time
public double netto_time
public double netdly_time
public double keepalive_time
public SLPacket getPacket() throws SeedLinkException
SeedLinkException
- if there is not a packet ready to send.packetAvailable()
public boolean packetAvailable()
getPacket()
public int bytesRemaining()
public boolean isError() throws SeedLinkException
SeedLinkException
- if there are not enough bytes to determinepublic boolean isEnd() throws SeedLinkException
SeedLinkException
- if there are not enough bytes to determinepublic boolean packetIsInfo() throws SeedLinkException
SeedLinkException
- if there are not enough bytes to determine packet typepublic void incrementSendPointer()
public void packDataBuffer()
public void appendBytes(byte[] bytes) throws SeedLinkException
SeedLinkException