Wiselib
|
#include <echo.h>
Classes | |
struct | messages_statistics |
struct | neighbor_entry |
struct | reg_alg_entry |
Public Types | |
enum | error_codes { SUCCESS = OsModel::SUCCESS, RGD_NUM_INUSE = 1, RGD_LIST_FULL = 2, INV_ALG_ID = 3 } |
enum | event_codes { NEW_NB = 1, NEW_NB_BIDI = 2, DROPPED_NB = 4, NEW_PAYLOAD = 8, NEW_PAYLOAD_BIDI = 16, LOST_NB_BIDI = 32, NB_READY = 64, DEFAULT = 5 } |
typedef OsModel_P | OsModel |
typedef Radio_P | Radio |
typedef Timer_P | Timer |
typedef Debug_P | Debug |
typedef OsModel_P::Clock | Clock |
typedef Radio::node_id_t | node_id_t |
typedef Radio::size_t | size_t |
typedef Radio::block_data_t | block_data_t |
typedef Radio::message_id_t | message_id_t |
typedef Clock::time_t | time_t |
typedef Radio::ExtendedData | ExData |
typedef Radio::TxPower | TxPower |
typedef EchoMsg< OsModel, Radio > | EchoMsg_t |
typedef Echo< OsModel_P, Radio_P, Timer_P, Debug_P > | self_t |
typedef delegate4< void, uint8_t, node_id_t, uint8_t, uint8_t * > | event_notifier_delegate_t |
typedef struct reg_alg_entry | reg_alg_entry_t |
typedef wiselib::vector_static < OsModel, reg_alg_entry_t, TOTAL_REG_ALG > | reg_alg_vector_t |
typedef reg_alg_vector_t::iterator | reg_alg_iterator_t |
typedef struct neighbor_entry | neighbor_entry_t |
Type of the structure that hold the relevant neighbor data. | |
typedef wiselib::vector_static < OsModel, neighbor_entry_t, ECHO_MAX_NODES > | node_info_vector_t |
Type of the Vector Containing information for all nodes in the Neighborhood. | |
typedef node_info_vector_t::iterator | iterator_t |
Public Member Functions | |
Echo () | |
Constructor. | |
~Echo () | |
Destructor. | |
void | enable () |
Enable the Echo system enable radio and register receive callback initialize vectors change status to SEARCHING start sending hello messages. | |
void | disable () |
Disable the Echo protocol. | |
void | init_echo () |
Initialize vectors and variables for Neighborhood Discovery. | |
uint16_t | msgs_count () |
uint32_t | msgs_size () |
uint16_t | get_node_stability () |
uint8_t | register_payload_space (uint8_t payload_id) |
It is used for registering a position in the hello msg payload in order to piggyback the applications data. | |
uint8_t | unregister_payload_space (uint8_t payload_id) |
It is used for unregistering a position in the hello msg. | |
uint8_t | set_payload (uint8_t payload_id, uint8_t *data, uint8_t len) |
It sets the payload for a specific application that is going to be piggybacked in the next hello msg. | |
bool | is_neighbor (node_id_t id) |
bool | is_neighbor_bidi (node_id_t id) |
uint8_t | nb_size (void) |
uint8_t | stable_nb_size (void) |
uint8_t | bidi_nb_size (void) |
uint8_t | get_link_assoc (node_id_t neighbor_id) |
uint8_t | get_ilink_assoc (node_id_t neighbor_id) |
uint8_t | get_nb_stability (node_id_t id) |
uint8_t | get_nb_receive_stability (node_id_t id) |
void | init (Radio &radio, Clock &clock, Timer &timer, Debug &debug) |
Initialize the module. | |
void | init (Radio &radio, Clock &clock, Timer &timer, Debug &debug, uint16_t beacon_pd, uint16_t timeout_pd, uint8_t min_theshold, uint8_t max_threshold) |
Initialize the module. | |
void | set_beacon_period (uint16_t beacon_pd) |
void | set_timeout_perdio (uint16_t timeout_pd) |
template<class T , void(T::*)(uint8_t, node_id_t, uint8_t, uint8_t *) TMethod> | |
uint8_t | reg_event_callback (uint8_t alg_id, uint8_t events_flag, T *obj_pnt) |
void | unreg_event_callback (uint8_t alg_id) |
void | register_debug_callback (uint8_t flags) |
Register a callback that prints debug information upon any generated event. | |
Public Attributes | |
TxPower | power |
reg_alg_vector_t | registered_apps |
Actual Vector containing callbacks for all the register applications. | |
node_info_vector_t | neighborhood |
Actual Vector containing the nodes in the neighborhood. |
Echo.
typedef Radio::block_data_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::block_data_t |
typedef OsModel_P::Clock wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::Clock |
typedef Debug_P wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::Debug |
typedef EchoMsg<OsModel, Radio> wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::EchoMsg_t |
typedef delegate4<void, uint8_t, node_id_t, uint8_t, uint8_t*> wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::event_notifier_delegate_t |
typedef Radio::ExtendedData wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::ExData |
typedef node_info_vector_t::iterator wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::iterator_t |
typedef Radio::message_id_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::message_id_t |
typedef struct neighbor_entry wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::neighbor_entry_t |
Type of the structure that hold the relevant neighbor data.
typedef Radio::node_id_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::node_id_t |
typedef wiselib::vector_static<OsModel, neighbor_entry_t, ECHO_MAX_NODES> wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::node_info_vector_t |
Type of the Vector Containing information for all nodes in the Neighborhood.
typedef OsModel_P wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::OsModel |
typedef Radio_P wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::Radio |
typedef struct reg_alg_entry wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::reg_alg_entry_t |
typedef reg_alg_vector_t::iterator wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::reg_alg_iterator_t |
typedef wiselib::vector_static<OsModel, reg_alg_entry_t, TOTAL_REG_ALG> wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::reg_alg_vector_t |
typedef Echo<OsModel_P, Radio_P, Timer_P, Debug_P> wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::self_t |
typedef Radio::size_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::size_t |
typedef Clock::time_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::time_t |
typedef Timer_P wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::Timer |
typedef Radio::TxPower wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::TxPower |
enum wiselib::Echo::error_codes |
enum wiselib::Echo::event_codes |
wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::Echo | ( | ) | [inline] |
Constructor.
Sets status to waiting.
wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::~Echo | ( | ) | [inline] |
Destructor.
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::bidi_nb_size | ( | void | ) | [inline] |
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::disable | ( | void | ) | [inline] |
Disable the Echo protocol.
Disables the Echo protocol. The module will unregister the receive callback, and will stop send beacons. The timer will keep triggering every beacon_period Millis. All the existing neighbors will timeout at most after timeout_period and the NB_DROPPED events will be generated.
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::enable | ( | void | ) | [inline] |
Enable the Echo system enable radio and register receive callback initialize vectors change status to SEARCHING start sending hello messages.
Enable normal radio and register the receive callback.
Initialize vectors and variables.
Code for paying with different TxPower values.
Set the status of the module: SEARCHING.
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::get_ilink_assoc | ( | node_id_t | neighbor_id | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::get_link_assoc | ( | node_id_t | neighbor_id | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::get_nb_receive_stability | ( | node_id_t | id | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::get_nb_stability | ( | node_id_t | id | ) | [inline] |
uint16_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::get_node_stability | ( | ) | [inline] |
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::init | ( | Radio & | radio, |
Clock & | clock, | ||
Timer & | timer, | ||
Debug & | debug | ||
) | [inline] |
Initialize the module.
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::init | ( | Radio & | radio, |
Clock & | clock, | ||
Timer & | timer, | ||
Debug & | debug, | ||
uint16_t | beacon_pd, | ||
uint16_t | timeout_pd, | ||
uint8_t | min_theshold, | ||
uint8_t | max_threshold | ||
) | [inline] |
Initialize the module.
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::init_echo | ( | ) | [inline] |
Initialize vectors and variables for Neighborhood Discovery.
It will initialize all the the relevant structures and variables of the module: clear neighborhood vector set the node stability to zero.
bool wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::is_neighbor | ( | node_id_t | id | ) | [inline] |
bool wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::is_neighbor_bidi | ( | node_id_t | id | ) | [inline] |
uint16_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::msgs_count | ( | ) | [inline] |
uint32_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::msgs_size | ( | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::nb_size | ( | void | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::reg_event_callback | ( | uint8_t | alg_id, |
uint8_t | events_flag, | ||
T * | obj_pnt | ||
) | [inline] |
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::register_debug_callback | ( | uint8_t | flags | ) | [inline] |
Register a callback that prints debug information upon any generated event.
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::register_payload_space | ( | uint8_t | payload_id | ) | [inline] |
It is used for registering a position in the hello msg payload in order to piggyback the applications data.
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::set_beacon_period | ( | uint16_t | beacon_pd | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::set_payload | ( | uint8_t | payload_id, |
uint8_t * | data, | ||
uint8_t | len | ||
) | [inline] |
It sets the payload for a specific application that is going to be piggybacked in the next hello msg.
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::set_timeout_perdio | ( | uint16_t | timeout_pd | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::stable_nb_size | ( | void | ) | [inline] |
void wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::unreg_event_callback | ( | uint8_t | alg_id | ) | [inline] |
uint8_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::unregister_payload_space | ( | uint8_t | payload_id | ) | [inline] |
It is used for unregistering a position in the hello msg.
node_info_vector_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::neighborhood |
Actual Vector containing the nodes in the neighborhood.
TxPower wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::power |
reg_alg_vector_t wiselib::Echo< OsModel_P, Radio_P, Timer_P, Debug_P >::registered_apps |
Actual Vector containing callbacks for all the register applications.