Common functionality for phase optimization in duty cycling radio protocols
#include "net/linkaddr.h"
#include "sys/timer.h"
#include "sys/rtimer.h"
#include "lib/list.h"
#include "lib/memb.h"
#include "net/netstack.h"
Enumerations | |
enum | phase_status_t { PHASE_UNKNOWN, PHASE_SEND_NOW, PHASE_DEFERRED } |
Functions | |
void | phase_init (void) |
void | phase_remove (const linkaddr_t *neighbor) |
void | phase_update (const linkaddr_t *neighbor, rtimer_clock_t time, int mac_status) |
phase_status_t | phase_wait (const linkaddr_t *neighbor, rtimer_clock_t cycle_time, rtimer_clock_t wait_before, mac_callback_t mac_callback, void *mac_callback_ptr, struct rdc_buf_list *buf_list) |
enum phase_status_t |
void phase_init | ( | void | ) |
References memb_init(), nbr_table_register(), and NULL.
Referenced by init().
void phase_remove | ( | const linkaddr_t * | neighbor | ) |
void phase_update | ( | const linkaddr_t * | neighbor, |
rtimer_clock_t | time, | ||
int | mac_status | ||
) |
References MAC_TX_NOACK, MAC_TX_OK, MAX_NOACKS, MAX_NOACKS_TIME, nbr_table_add_lladdr(), nbr_table_get_from_lladdr(), nbr_table_remove(), phase::noacks, phase::noacks_timer, NULL, PRINTF, phase::time, timer_expired(), timer_set(), and linkaddr_t::u8.
Referenced by send_packet().
phase_status_t phase_wait | ( | const linkaddr_t * | neighbor, |
rtimer_clock_t | cycle_time, | ||
rtimer_clock_t | wait_before, | ||
mac_callback_t | mac_callback, | ||
void * | mac_callback_ptr, | ||
struct rdc_buf_list * | buf_list | ||
) |
References phase_queueitem::buf_list, CLOCK_SECOND, ctimer_set(), phase_queueitem::mac_callback, phase_queueitem::mac_callback_ptr, memb_alloc(), nbr_table_get_from_lladdr(), NULL, PHASE_DEFER_THRESHOLD, PHASE_DEFERRED, PHASE_DRIFT_CORRECT, PHASE_SEND_NOW, phase_queueitem::q, queuebuf_new_from_packetbuf(), RTIMER_CLOCK_LT, RTIMER_NOW, s, send_packet(), sync(), phase::time, and phase_queueitem::timer.
Referenced by send_packet().