com.sentilla.net
Interface ByteReceiver

All Superinterfaces:
Action, ByteMessage
All Known Implementing Classes:
ByteReceiver

public interface ByteReceiver
extends ByteMessage

Receives a message from the radio into a byte buffer. Its action verb is receive.


Field Summary
static int ANY_ADDR
           
static int ANY_PORT
           
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Method Summary
 int getLength()
          Returns the number of bytes in the original message.
 int getLqi()
          Returns the Link Quality Indicator (LQI) of the received message.
 int getRssi()
          Returns the Received Signal Strength Indicator (RSSI) of the received message.
 void receive(byte[] buf, int offset)
          Receive data into a byte array, starting at offset.
 void receive(ByteBuffer buf)
          Receive data into a ByteBuffer.
 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.
 
Methods inherited from interface com.sentilla.net.ByteMessage
getPort, getTimestamp, setPort
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, isDone, submit
 

Field Detail

ANY_PORT

static final int ANY_PORT
See Also:
Constant Field Values

ANY_ADDR

static final int ANY_ADDR
See Also:
Constant Field Values
Method Detail

receive

void receive(ByteBuffer buf)
Receive data into a ByteBuffer.

Parameters:
buf - ByteBuffer to receive data into

receive

void receive(byte[] buf,
             int offset)
Receive data into a byte array, starting at offset.

Parameters:
buf - byte array to receive data into
offset - offset in the byte array to begin placing received data

setReceive

ByteReceiver setReceive(ByteBuffer buf)
Set the ByteBuffer to receive data into, but do not submit to the kernel.

Parameters:
buf - ByteBuffer to receive data into
Returns:
this

setReceive

ByteReceiver setReceive(byte[] buf,
                        int offset)
Set the byte array to receive data into, but do not submit to the kernel.

Parameters:
buf - the byte array to receive data into
offset - the offset in the array to begin writing the data
Returns:
this

getLength

int getLength()
Returns the number of bytes in the original message.

Returns:
integer number of bytes in the message

getRssi

int getRssi()
Returns the Received Signal Strength Indicator (RSSI) of the received message.

Returns:
the RSSI of the received message.

getLqi

int getLqi()
Returns the Link Quality Indicator (LQI) of the received message.

Returns:
the LQI of the received message


Copyright © 2007 Sentilla Corporation. All Rights Reserved.