49 #define PRINTF(...) printf(__VA_ARGS__)
66 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_CHANNEL
67 #define BROADCAST_ANNOUNCEMENT_CHANNEL RIME_CONF_BROADCAST_ANNOUNCEMENT_CHANNEL
69 #define BROADCAST_ANNOUNCEMENT_CHANNEL 2
72 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_BUMP_TIME
73 #define BROADCAST_ANNOUNCEMENT_BUMP_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_BUMP_TIME
75 #define BROADCAST_ANNOUNCEMENT_BUMP_TIME CLOCK_SECOND * 8
78 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_MIN_TIME
79 #define BROADCAST_ANNOUNCEMENT_MIN_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_MIN_TIME
81 #define BROADCAST_ANNOUNCEMENT_MIN_TIME CLOCK_SECOND * 60
84 #ifdef RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME
85 #define BROADCAST_ANNOUNCEMENT_MAX_TIME RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME
87 #define BROADCAST_ANNOUNCEMENT_MAX_TIME CLOCK_SECOND * 3600UL
95 rime_sniffer_add(
struct rime_sniffer *s)
101 rime_sniffer_remove(
struct rime_sniffer *s)
109 struct rime_sniffer *s;
113 c = chameleon_parse();
116 if(s->input_callback !=
NULL) {
133 rime_mac = &NETSTACK_MAC;
144 broadcast_announcement_init(BROADCAST_ANNOUNCEMENT_CHANNEL,
145 BROADCAST_ANNOUNCEMENT_BUMP_TIME,
146 BROADCAST_ANNOUNCEMENT_MIN_TIME,
147 BROADCAST_ANNOUNCEMENT_MAX_TIME);
151 packet_sent(
void *ptr,
int status,
int num_tx)
153 struct channel *c = ptr;
154 struct rime_sniffer *s;
158 PRINTF(
"rime: collision after %d tx\n", num_tx);
161 PRINTF(
"rime: noack after %d tx\n", num_tx);
164 PRINTF(
"rime: sent after %d tx\n", num_tx);
167 PRINTF(
"rime: error %d after %d tx\n", status, num_tx);
172 if(s->output_callback !=
NULL) {
173 s->output_callback(status);
177 abc_sent(c, status, num_tx);
181 rime_output(
struct channel *c)
184 if(chameleon_create(c)) {
187 NETSTACK_MAC.send(packet_sent, c);