Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.RouteSelect.nc

Interface: RouteSelect

Interface to a route selection component in the TinyOS ad-hoc system architecture.
Author: Philip Levis

Components providing this interface:
tos.lib.Route.MultiHopLEPSM

Components requiring this interface:
tos.lib.Route.MultiHopEngineM

Commands

Commands - Details

isActive

bool isActive(void)

Whether there is currently a valid route.
Returns: Whether there is a valid route.

selectRoute

result_t selectRoute(TOS_MsgPtr msg, uint8_t id)

Select a route and fill in all of the necessary routing information to a packet.

Parameters:

msg - Message to select route for and fill in routing information.

Returns: Whether a route was selected succesfully. On FAIL the packet should not be sent.

initializeFields

result_t initializeFields(TOS_MsgPtr msg, uint8_t id)

Given a TOS_MstPtr, initialize its routing fields to a known state, specifying that the message is originating from this node. This known state can then be used by selectRoute() to fill in the necessary data.

Parameters:

msg - Message to select route for and fill in init data.

Returns: Should always return SUCCESS.

getBuffer

uint8_t getBuffer(TOS_MsgPtr msg, uint16_t *len)

Given a TinyOS message buffer, provide a pointer to the data buffer within it that an application can use as well as its length. Unlike the getBuffer of the Send interface, this can be called freely and does not modify the buffer.

Parameters:

msg - The message to get the data region of.

length - Pointer to a field to store the length of the data region.

Returns: A pointer to the data region.