48 #define PRINTF(...) printf(__VA_ARGS__)
63 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_CHANNEL
64 #define BROADCAST_ANNOUNCEMENT_CHANNEL RIME_CONF_BROADCAST_ANNOUNCEMENT_CHANNEL
66 #define BROADCAST_ANNOUNCEMENT_CHANNEL 2
69 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_BUMP_TIME
70 #define BROADCAST_ANNOUNCEMENT_BUMP_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_BUMP_TIME
72 #define BROADCAST_ANNOUNCEMENT_BUMP_TIME CLOCK_SECOND * 32 / NETSTACK_RDC_CHANNEL_CHECK_RATE
75 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_MIN_TIME
76 #define BROADCAST_ANNOUNCEMENT_MIN_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_MIN_TIME
78 #define BROADCAST_ANNOUNCEMENT_MIN_TIME CLOCK_SECOND * 60
81 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME
82 #define BROADCAST_ANNOUNCEMENT_MAX_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME
84 #define BROADCAST_ANNOUNCEMENT_MAX_TIME CLOCK_SECOND * 3600UL
92 rime_sniffer_add(
struct rime_sniffer *s)
98 rime_sniffer_remove(
struct rime_sniffer *s)
106 struct rime_sniffer *s;
110 c = chameleon_parse();
113 if(s->input_callback !=
NULL) {
140 broadcast_announcement_init(BROADCAST_ANNOUNCEMENT_CHANNEL,
141 BROADCAST_ANNOUNCEMENT_BUMP_TIME,
142 BROADCAST_ANNOUNCEMENT_MIN_TIME,
143 BROADCAST_ANNOUNCEMENT_MAX_TIME);
149 struct channel *c = ptr;
150 struct rime_sniffer *s;
154 PRINTF(
"rime: collision after %d tx\n", num_tx);
157 PRINTF(
"rime: noack after %d tx\n", num_tx);
160 PRINTF(
"rime: sent after %d tx\n", num_tx);
163 PRINTF(
"rime: error %d after %d tx\n", status, num_tx);
168 if(s->output_callback !=
NULL) {
169 s->output_callback(status);
173 abc_sent(c, status, num_tx);
177 rime_output(
struct channel *c)
180 if(chameleon_create(c)) {
void list_remove(list_t list, void *item)
Remove a specific element from a list.
Header file for the announcement primitive
The MAC layer deferred the transmission for a later time.
The MAC layer did not get an acknowledgement for the packet.
#define LIST(name)
Declare a linked list.
Header file for Chameleon, Rime's header processing module
void packetbuf_clear(void)
Clear and reset the packetbuf.
static void input(void)
Process a received 6lowpan packet.
void * list_item_next(void *item)
Get the next item following this item.
void packetbuf_compact(void)
Compact the packetbuf.
static void packet_sent(void *ptr, int status, int transmissions)
Callback function for the MAC packet sent callback.
Neighbor discovery header file
void * list_head(list_t list)
Get a pointer to the first element of a list.
Header file for the Rime stack
The MAC layer transmission was OK.
#define NULL
The null pointer.
void list_add(list_t list, void *item)
Add an item at the end of a list.
Header file for the Rime route table
Linked list manipulation routines.
void announcement_init(void)
Initialize the announcement module.
void abc_input(struct channel *channel)
Internal Rime function: Pass a packet to the abc layer.
void(* init)(void)
Initialize the network driver.
The structure of a network driver in Contiki.
Include file for the Contiki low-layer network stack (NETSTACK)