com.sentilla.platform.tmote
Class ByteSender

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

public class ByteSender
extends Action
implements ByteSender

Tmote implementation of ByteSender.


Field Summary
 boolean ack
           
static long AM_BROADCAST_ADDR
           
 short amtype
           
 long destAddress
           
 byte devInterface
           
 int timestamp
           
 
Fields inherited from class com.sentilla.platform.tmote.Action
actionAuto, actionId, actionState, isolateOwner
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
ByteSender(int amtype)
           
 
Method Summary
 long getDestAddress()
          Get the long destination address previously set with setDestAddress.
 int getPort()
          Returns the currently set port.
 long getTimestamp()
          Returns the message timestamp.
 void send(byte[] buf, int offset, int length)
          Transmits length bytes from a byte array, starting at offset.
 void send(com.sentilla.io.ByteBuffer buf)
          Transmits a ByteBuffer.
 ByteSender setDestAddress(long addr)
          Sets the 64-bit Mac destination address.
 ByteSender setPort(int port)
          Sets the port for message transmissions.
 ByteSender setSend(byte[] buf, int offset, int length)
          Set the byte array containing the data to transmit.
 ByteSender setSend(com.sentilla.io.ByteBuffer buf)
          Set the ByteBuffer containing data to be transmitted.
 
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

AM_BROADCAST_ADDR

public static final long AM_BROADCAST_ADDR
See Also:
Constant Field Values

amtype

public short amtype

timestamp

public int timestamp

destAddress

public long destAddress

devInterface

public byte devInterface

ack

public boolean ack
Constructor Detail

ByteSender

public ByteSender(int amtype)
Method Detail

send

public void send(com.sentilla.io.ByteBuffer buf)
Description copied from interface: ByteSender
Transmits a ByteBuffer.

Specified by:
send in interface ByteSender
Parameters:
buf - the ByteBuffer to send

send

public void send(byte[] buf,
                 int offset,
                 int length)
Description copied from interface: ByteSender
Transmits length bytes from a byte array, starting at offset.

Specified by:
send in interface ByteSender
Parameters:
buf - the byte array containing the data to transmit
offset - the offset of the data in the byte array
length - the length in bytes of the data to transmit

setSend

public ByteSender setSend(com.sentilla.io.ByteBuffer buf)
Description copied from interface: ByteSender
Set the ByteBuffer containing data to be transmitted.

Specified by:
setSend in interface ByteSender
Parameters:
buf - the ByteBuffer containing the data to be transmitted
Returns:
this

setSend

public ByteSender setSend(byte[] buf,
                          int offset,
                          int length)
Description copied from interface: ByteSender
Set the byte array containing the data to transmit.

Specified by:
setSend in interface ByteSender
Parameters:
buf - byte array containing the data to transmit
offset - the offset of the data in the array
length - the length in bytes of data to transmit
Returns:
this

setPort

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

Specified by:
setPort in interface ByteMessage
Parameters:
port - 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

setDestAddress

public ByteSender setDestAddress(long addr)
Sets the 64-bit Mac destination address. Note that this address will persist across sends and must be changed to send to a different address (including broadcast.)


getDestAddress

public long getDestAddress()
Get the long destination address previously set with setDestAddress.


getTimestamp

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

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


Copyright © 2007 Sentilla Corporation. All Rights Reserved.