|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.platform.cmote.ByteReceiver
public class ByteReceiver
Field Summary |
---|
Fields inherited from interface com.sentilla.net.ByteReceiver |
---|
ANY_ADDR, ANY_PORT |
Constructor Summary | |
---|---|
ByteReceiver(int port)
|
Method Summary | |
---|---|
Action |
block()
Block an indefinite amount of time until this Action is no longer pending. |
Action |
block(int timeoutMilli)
Block a defined amount of time or until the Action is no longer pending. |
Action |
cancel()
Cancel this Action if PENDING. |
byte |
getActionState()
Get the current state of this Action: IDLE, PENDING, DONE, or ERROR. |
int |
getLength()
Returns the number of bytes in the original message. |
int |
getLqi()
Returns the Link Quality Indicator (LQI) of the received message. |
int |
getPort()
Returns the currently set port. |
int |
getRssi()
Returns the Received Signal Strength Indicator (RSSI) of the received message. |
long |
getTimestamp()
Returns the message timestamp. |
boolean |
isDone()
Return true is this Action is DONE. |
void |
receive(byte[] buf,
int offset)
Receive data into a byte array, starting at offset. |
void |
receive(ByteBuffer buf)
Receive data into a ByteBuffer . |
ByteMessage |
setPort(int port)
Sets the port for message transmissions. |
ByteReceiver |
setReceive(byte[] buf,
int offset)
Set the byte array to receive data into, but do not submit to the kernel. |
ByteReceiver |
setReceive(ByteBuffer buf)
Set the ByteBuffer to receive data into, but do not submit to the kernel. |
Action |
submit()
Submit this Action for processing by the action engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteReceiver(int port)
Method Detail |
---|
public int getLength()
ByteReceiver
getLength
in interface ByteReceiver
public int getLqi()
ByteReceiver
getLqi
in interface ByteReceiver
public int getRssi()
ByteReceiver
getRssi
in interface ByteReceiver
public void receive(ByteBuffer buf)
ByteReceiver
ByteBuffer
.
receive
in interface ByteReceiver
buf
- ByteBuffer to receive data intopublic void receive(byte[] buf, int offset)
ByteReceiver
receive
in interface ByteReceiver
buf
- byte array to receive data intooffset
- offset in the byte array to begin placing received datapublic ByteReceiver setReceive(ByteBuffer buf)
ByteReceiver
setReceive
in interface ByteReceiver
buf
- ByteBuffer to receive data into
this
public ByteReceiver setReceive(byte[] buf, int offset)
ByteReceiver
setReceive
in interface ByteReceiver
buf
- the byte array to receive data intooffset
- the offset in the array to begin writing the data
this
public int getPort()
ByteMessage
getPort
in interface ByteMessage
public long getTimestamp()
ByteMessage
getTimestamp
in interface ByteMessage
public ByteMessage setPort(int port)
ByteMessage
setPort
in interface ByteMessage
port
- the port bytes should be sent to
this
public Action block() throws ActionException
Action
block
in interface Action
ActionException
public Action block(int timeoutMilli) throws ActionException
Action
block
in interface Action
timeoutMilli
- the maximum number of milliseconds to block
ActionException
public Action cancel()
Action
cancel
in interface Action
public byte getActionState()
Action
getActionState
in interface Action
public boolean isDone() throws ActionException
Action
isDone
in interface Action
ActionException
public Action submit()
Action
submit
in interface Action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |