Interface: moteiv.tos.lib.MultiHopLQI.RouteSelect

interface RouteSelect

Interface to a route selection component in the TinyOS ad-hoc system architecture.

Author:
Philip Levis

Commands
command 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.
command 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.
command bool isActive() Whether there is currently a valid route.
command bool isDuplicate(TOS_MsgPtr msg, uint8_t id)
command result_t selectRoute(TOS_MsgPtr msg, uint8_t id, uint8_t resend) Select a route and fill in all of the necessary routing information to a packet.

Commands - Details

getBuffer

command 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.

initializeFields

command 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.

isActive

command bool isActive()

Whether there is currently a valid route.

Returns:
Whether there is a valid route.

isDuplicate

command bool isDuplicate(TOS_MsgPtr msg, uint8_t id)

selectRoute

command result_t selectRoute(TOS_MsgPtr msg, uint8_t id, uint8_t resend)

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.