Wiselib
Public Types | Public Member Functions
wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS > Class Template Reference

Tree routing implementation of Routing ConceptTree routing implementation of Routing Concept ... More...

#include <controlled_topology_tree_routing.h>

Inherits wiselib::RoutingBase< OsModel_P, Radio_P >.

List of all members.

Public Types

enum  ErrorCodes { SUCCESS = OsModel::SUCCESS, ERR_UNSPEC = OsModel::ERR_UNSPEC, ERR_NOTIMPL = OsModel::ERR_NOTIMPL, ERR_HOSTUNREACH = OsModel::ERR_HOSTUNREACH }
enum  SpecialNodeIds { BROADCAST_ADDRESS = Radio_P::BROADCAST_ADDRESS, NULL_NODE_ID = Radio_P::NULL_NODE_ID }
enum  Restrictions { MAX_MESSAGE_LENGTH = Radio_P::MAX_MESSAGE_LENGTH - RoutingMessage::PAYLOAD_POS }
typedef OsModel_P OsModel
typedef Timer_P Timer
typedef Radio_P Radio
typedef Debug_P Debug
typedef
ControlledTopologyTreeRouting
< OsModel, Timer, Radio, Debug,
MAX_NEIGHBORS > 
self_type
typedef Radio::node_id_t node_id_t
typedef Radio::size_t size_t
typedef Radio::block_data_t block_data_t
typedef uint8_t message_id_t
typedef Timer::millis_t millis_t
typedef TreeBroadcastMessage
< OsModel, Radio
BroadcastMessage
typedef TreeRoutingMessage
< OsModel, Radio
RoutingMessage
typedef vector_static< OsModel,
node_id_t, MAX_NEIGHBORS > 
Neighbors
enum  ReturnValues
typedef delegate3< void,
node_id_t, size_t,
block_data_t * > 
radio_delegate_t
typedef vector_static< OsModel,
radio_delegate_t,
MAX_RECEIVERS > 
CallbackVector
typedef CallbackVector::iterator CallbackVectorIterator

Public Member Functions

void set_topology (Neighbors *t=0)
Neighborstopology ()
node_id_t parent () const
void init (Radio &radio, Timer &timer)
void destruct ()
int reg_recv_callback (T *obj_pnt)
int unreg_recv_callback (int idx)
void notify_receivers (node_id_t from, size_t len, block_data_t *data)
Construction / Destruction
 ControlledTopologyTreeRouting ()
 ~ControlledTopologyTreeRouting ()
Routing Control
void enable (void)
 Initialization/Start Routing.
void disable (void)
 Stop Routing.
void set_sink (bool sink)
 Set State.
Routing Functionality
void send (node_id_t receiver, size_t len, block_data_t *data)
Methods called by Timer
void timer_elapsed (void *userdata)
 Periodic Tasks.
Methods called by RadioModel
void receive (node_id_t from, size_t len, block_data_t *data)
 Callback on Received Messages.

Detailed Description

template<typename OsModel_P, typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
class wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >

Tree routing implementation of Routing Concept

Tree routing implementation of Routing Concept ...


Member Typedef Documentation

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Radio::block_data_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::block_data_t
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef TreeBroadcastMessage<OsModel, Radio> wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::BroadcastMessage
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Debug_P wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::Debug
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef uint8_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::message_id_t
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Timer::millis_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::millis_t
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef vector_static<OsModel,node_id_t,MAX_NEIGHBORS> wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::Neighbors
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Radio::node_id_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::node_id_t
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef OsModel_P wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::OsModel
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Radio_P wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::Radio
typedef delegate3<void, node_id_t, size_t, block_data_t*> wiselib::RadioBase< OsModel_P, Radio_P::node_id_t , Radio_P::size_t , Radio_P::block_data_t , MAX_RECEIVERS >::radio_delegate_t [inherited]
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef TreeRoutingMessage<OsModel, Radio> wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::RoutingMessage
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef ControlledTopologyTreeRouting<OsModel, Timer, Radio, Debug, MAX_NEIGHBORS> wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::self_type
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Radio::size_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::size_t
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
typedef Timer_P wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::Timer

Member Enumeration Documentation

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
enum wiselib::ControlledTopologyTreeRouting::ErrorCodes
Enumerator:
SUCCESS 
ERR_UNSPEC 
ERR_NOTIMPL 
ERR_HOSTUNREACH 
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
enum wiselib::ControlledTopologyTreeRouting::Restrictions
Enumerator:
MAX_MESSAGE_LENGTH 

Maximal number of bytes in payload.

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
enum wiselib::ControlledTopologyTreeRouting::SpecialNodeIds
Enumerator:
BROADCAST_ADDRESS 

All nodes in communication range.

NULL_NODE_ID 

Unknown/No node id.


Constructor & Destructor Documentation

template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::ControlledTopologyTreeRouting ( )
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::~ControlledTopologyTreeRouting ( )

Member Function Documentation

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::destruct ( void  ) [inline]
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::disable ( void  )

Stop Routing.

...

template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::enable ( void  )

Initialization/Start Routing.

This methods does the initilaization that requires access to the OS (and thus can not be done in the constructor). E.g., callbacks in task manager and radio are registered, and state variables regarding acting as gateway or ordinary node are set.

At last, the network begins to build the routing tree. The gateway periodically sends out flooding messages. Every node that receives such a message updates its parent (if the received hop-distance to the gate is smaller than the known one), and then begins to send own flooding messages.

Flooding messages in this context does not mean flooding the whole network. Instead, they are just local broadcast messages, but since every node with a parent broadcasts such messages, the whole network is covere

Parameters:
osReference to operating system
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::init ( Radio radio,
Timer timer 
) [inline]
void wiselib::RadioBase< OsModel_P, Radio_P::node_id_t , Radio_P::size_t , Radio_P::block_data_t , MAX_RECEIVERS >::notify_receivers ( node_id_t  from,
size_t  len,
block_data_t data 
) [inline, inherited]
template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
node_id_t wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::parent ( void  ) const [inline]
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::receive ( node_id_t  from,
size_t  len,
block_data_t data 
)

Callback on Received Messages.

Called if a message is received via the radio interface.

See also:
Radio concept
int wiselib::RadioBase< OsModel_P, Radio_P::node_id_t , Radio_P::size_t , Radio_P::block_data_t , MAX_RECEIVERS >::reg_recv_callback ( T *  obj_pnt) [inline, inherited]
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::send ( node_id_t  receiver,
size_t  len,
block_data_t data 
)
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::set_sink ( bool  sink) [inline]

Set State.

...

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::set_topology ( Neighbors t = 0) [inline]
template<typename OsModel_P , typename Timer_P , typename Radio_P , typename Debug_P , typename OsModel_P::size_t MAX_NEIGHBORS>
void wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::timer_elapsed ( void *  userdata)

Periodic Tasks.

This method is called periodically with intervals defined by ::work_period_. Each connected node (the gateway and nodes that have a parent) broadcast a message with their current hopcount, so that newly installed nodes can connect to the tree. If a node is not yet connected, it prints out an appropriate debug message.

template<typename OsModel_P , typename Timer_P = typename OsModel_P::Timer, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug, typename OsModel_P::size_t MAX_NEIGHBORS = 32>
Neighbors* wiselib::ControlledTopologyTreeRouting< OsModel_P, Timer_P, Radio_P, Debug_P, MAX_NEIGHBORS >::topology ( ) [inline]
int wiselib::RadioBase< OsModel_P, Radio_P::node_id_t , Radio_P::size_t , Radio_P::block_data_t , MAX_RECEIVERS >::unreg_recv_callback ( int  idx) [inline, inherited]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines