Common functionality for phase optimization in duty cycling radio protocols
#include "net/mac/phase.h"
#include "net/packetbuf.h"
#include "sys/contiki-clock.h"
#include "sys/ctimer.h"
#include "net/queuebuf.h"
#include "net/nbr-table.h"
Data Structures | |
struct | phase |
struct | phase_queueitem |
Macros | |
#define | _DEBUG_ 0 |
#define | MAX_NOACKS 16 |
#define | MAX_NOACKS_TIME CLOCK_SECOND * 30 |
#define | PHASE_CONF_DRIFT_CORRECT 0 |
#define | PHASE_DEFER_THRESHOLD 1 |
#define | PHASE_DRIFT_CORRECT 0 |
#define | PHASE_QUEUESIZE 8 |
#define | PRINTDEBUG(...) |
#define | PRINTF(...) |
Functions | |
MEMB (queued_packets_memb, struct phase_queueitem, PHASE_QUEUESIZE) | |
NBR_TABLE (struct phase, nbr_phase) | |
void | phase_init (void) |
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 guard_time, mac_callback_t mac_callback, void *mac_callback_ptr, struct rdc_buf_list *buf_list) |
static void | send_packet (void *ptr) |
#define _DEBUG_ 0 |
#define MAX_NOACKS 16 |
Referenced by phase_update().
#define MAX_NOACKS_TIME CLOCK_SECOND * 30 |
Referenced by phase_update().
#define PHASE_CONF_DRIFT_CORRECT 0 |
#define PHASE_DEFER_THRESHOLD 1 |
Referenced by phase_wait().
#define PHASE_DRIFT_CORRECT 0 |
Referenced by phase_wait().
#define PHASE_QUEUESIZE 8 |
#define PRINTDEBUG | ( | ... | ) |
#define PRINTF | ( | ... | ) |
Referenced by phase_update().
MEMB | ( | queued_packets_memb | , |
struct phase_queueitem | , | ||
PHASE_QUEUESIZE | |||
) |
NBR_TABLE | ( | struct phase | , |
nbr_phase | |||
) |
void phase_init | ( | void | ) |
References memb_init(), nbr_table_register(), and NULL.
Referenced by init().
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 | guard_time, | ||
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().
|
static |