com.sentilla.platform.tmote
Class ByteReceiver

java.lang.Object
  extended by com.sentilla.platform.tmote.Action
      extended by com.sentilla.platform.tmote.ByteReceiver
All Implemented Interfaces:
ByteMessage, ByteReceiver, Action

public class ByteReceiver
extends Action
implements ByteReceiver

Tmote implementation of ByteReceiver


Field Summary
 byte _reserved
           
 short amfilter
           
 short amtype
           
 long destAddress
           
 byte devInterface
           
 short length
           
 short lqi
           
 short rssi
           
 long sourceAddress
           
 int timestamp
           
 
Fields inherited from class com.sentilla.platform.tmote.Action
actionAuto, actionId, actionState, isolateOwner
 
Fields inherited from interface com.sentilla.net.ByteReceiver
ANY_ADDR, ANY_PORT
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
ByteReceiver(int amfilter)
           
 
Method Summary
 long getDestAddress()
          Get the destination address as a long.
 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 getSourceAddress()
          Get the source address as a long.
 long getTimestamp()
          Returns the message timestamp.
 void receive(byte[] buf, int offset)
          Receive data into a byte array, starting at offset.
 void receive(com.sentilla.io.ByteBuffer buf)
          Receive data into a ByteBuffer.
 ByteReceiver setPort(int amfilter)
          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(com.sentilla.io.ByteBuffer buf)
          Set the ByteBuffer to receive data into, but do not submit to the kernel.
 
Methods inherited from class com.sentilla.platform.tmote.Action
block, block, cancel, getActionState, initAction, isDone, lookup, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, isDone, submit
 

Field Detail

amtype

public short amtype

timestamp

public int timestamp

destAddress

public long destAddress

amfilter

public short amfilter

length

public short length

rssi

public short rssi

lqi

public short lqi

sourceAddress

public long sourceAddress

devInterface

public byte devInterface

_reserved

public byte _reserved
Constructor Detail

ByteReceiver

public ByteReceiver(int amfilter)
Method Detail

receive

public void receive(com.sentilla.io.ByteBuffer buf)
Description copied from interface: ByteReceiver
Receive data into a ByteBuffer.

Specified by:
receive in interface ByteReceiver
Parameters:
buf - ByteBuffer to receive data into

receive

public void receive(byte[] buf,
                    int offset)
Description copied from interface: ByteReceiver
Receive data into a byte array, starting at offset.

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

setReceive

public ByteReceiver setReceive(com.sentilla.io.ByteBuffer buf)
Description copied from interface: ByteReceiver
Set the ByteBuffer to receive data into, but do not submit to the kernel.

Specified by:
setReceive in interface ByteReceiver
Parameters:
buf - ByteBuffer to receive data into
Returns:
this

setReceive

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

Specified by:
setReceive in interface ByteReceiver
Parameters:
buf - the byte array to receive data into
offset - the offset in the array to begin writing the data
Returns:
this

setPort

public ByteReceiver setPort(int amfilter)
Description copied from interface: ByteMessage
Sets the port for message transmissions.

Specified by:
setPort in interface ByteMessage
Parameters:
amfilter - the port bytes should be sent to
Returns:
returns this

getPort

public int getPort()
Description copied from interface: ByteMessage
Returns the currently set port.

Specified by:
getPort in interface ByteMessage
Returns:
the integer port number

getTimestamp

public long getTimestamp()
Description copied from interface: ByteMessage
Returns the message timestamp.

Specified by:
getTimestamp in interface ByteMessage
Returns:
the long value timestamp

getDestAddress

public long getDestAddress()
Get the destination address as a long.


getLength

public int getLength()
Description copied from interface: ByteReceiver
Returns the number of bytes in the original message.

Specified by:
getLength in interface ByteReceiver
Returns:
integer number of bytes in the message

getRssi

public int getRssi()
Description copied from interface: ByteReceiver
Returns the Received Signal Strength Indicator (RSSI) of the received message.

Specified by:
getRssi in interface ByteReceiver
Returns:
the RSSI of the received message.

getLqi

public int getLqi()
Description copied from interface: ByteReceiver
Returns the Link Quality Indicator (LQI) of the received message.

Specified by:
getLqi in interface ByteReceiver
Returns:
the LQI of the received message

getSourceAddress

public long getSourceAddress()
Get the source address as a long.



Copyright © 2007 Sentilla Corporation. All Rights Reserved.