com.sentilla.net
Interface Receiver

All Superinterfaces:
Action
All Known Implementing Classes:
ClientRadioProtocol.Receiver, MimeoDisseminationProtocol.MimeoReceiver, Receiver

public interface Receiver
extends Action

Provides methods to receive messages from the mote communications interfaces.

Primary class for receiving messages and objects. Blocking and non-blocking methods for receiving a message provided. Message metadata can be obtained by calling the getNextReceiver method and accessing the Receiver metadata field directly.

see com.sentilla.platform.[tmote|cmote].DispatcherAction see com.sentilla.platform.[tmote|cmote].Dispatcher see com.sentilla.platform.[tmote|cmote].Protocol

See Also:
ReceiverDriver

Field Summary
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Method Summary
<M> M
getData()
          Returns the received object.
 Addressable getDestAddress()
          Returns the destination address of the last received message.
<R extends Receiver>
R
getMetadata(Class<R> c)
          Returns the platform specific receiver object that contains metadata about the received message.
 Addressable getSourceAddress()
          Returns the source address of the last received message.
<M> M
receive()
          Receives an object.
 Receiver setReceive()
          Sets the Receiver object to receive.
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, isDone, submit
 

Method Detail

receive

<M> M receive()
Receives an object. Blocks until an object is received. Object class is specified when creating the receiver object.

Returns:
received object.

setReceive

Receiver setReceive()
Sets the Receiver object to receive. Non-blocking action to receive an object. Object class is specified when creating the receiver object. Provided for consistency with Action interface.

Returns:
Receiver object see com.sentilla.platform.[tmote|cmote].DispatcherAction
See Also:
Action

getData

<M> M getData()
Returns the received object.

Returns:
received object.

getDestAddress

Addressable getDestAddress()
Returns the destination address of the last received message.

Returns:
an Addressable object containing the destination address
See Also:
Addressable

getSourceAddress

Addressable getSourceAddress()
Returns the source address of the last received message.

Returns:
an Addressable object containing the source address
See Also:
Addressable

getMetadata

<R extends Receiver> R getMetadata(Class<R> c)
Returns the platform specific receiver object that contains metadata about the received message. The metadata receiver object is used to obtain message metadata.

Returns:
a receiver object containing platform metadata


Copyright © 2007 Sentilla Corporation. All Rights Reserved.