70 #ifdef COLLECT_CONF_PACKET_ID_BITS
71 #define COLLECT_PACKET_ID_BITS COLLECT_CONF_PACKET_ID_BITS
73 #define COLLECT_PACKET_ID_BITS 8
76 #ifdef COLLECT_CONF_TTL_BITS
77 #define COLLECT_TTL_BITS COLLECT_CONF_TTL_BITS
79 #define COLLECT_TTL_BITS 4
82 #ifdef COLLECT_CONF_HOPS_BITS
83 #define COLLECT_HOPS_BITS COLLECT_CONF_HOPS_BITS
85 #define COLLECT_HOPS_BITS 4
88 #ifdef COLLECT_CONF_MAX_REXMIT_BITS
89 #define COLLECT_MAX_REXMIT_BITS COLLECT_CONF_MAX_REXMIT_BITS
91 #define COLLECT_MAX_REXMIT_BITS 5
94 #define COLLECT_ATTRIBUTES { PACKETBUF_ADDR_ESENDER, PACKETBUF_ADDRSIZE }, \
95 { PACKETBUF_ATTR_EPACKET_ID, PACKETBUF_ATTR_BIT * COLLECT_PACKET_ID_BITS }, \
96 { PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_BIT * COLLECT_PACKET_ID_BITS }, \
97 { PACKETBUF_ATTR_TTL, PACKETBUF_ATTR_BIT * COLLECT_TTL_BITS }, \
98 { PACKETBUF_ATTR_HOPS, PACKETBUF_ATTR_BIT * COLLECT_HOPS_BITS }, \
99 { PACKETBUF_ATTR_MAX_REXMIT, PACKETBUF_ATTR_BIT * COLLECT_MAX_REXMIT_BITS }, \
100 { PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_BIT }, \
103 struct collect_callbacks {
104 void (* recv)(
const linkaddr_t *originator, uint8_t seqno,
111 #ifndef COLLECT_CONF_ANNOUNCEMENTS
112 #define COLLECT_ANNOUNCEMENTS 1
114 #define COLLECT_ANNOUNCEMENTS COLLECT_CONF_ANNOUNCEMENTS
117 struct collect_conn {
118 struct unicast_conn unicast_conn;
119 #if ! COLLECT_ANNOUNCEMENTS
120 struct neighbor_discovery_conn neighbor_discovery_conn;
123 struct ctimer transmit_after_scan_timer;
125 const struct collect_callbacks *cb;
126 struct ctimer retransmission_timer;
129 struct collect_neighbor_list neighbor_list;
131 struct ctimer keepalive_timer;
132 clock_time_t keepalive_period;
134 struct ctimer proactive_probing_timer;
136 linkaddr_t parent, current_parent;
139 uint8_t sending, transmissions, max_rexmits;
143 clock_time_t send_time;
151 void collect_open(
struct collect_conn *c, uint16_t channels,
153 const struct collect_callbacks *callbacks);
154 void collect_close(
struct collect_conn *c);
156 int collect_send(
struct collect_conn *c,
int rexmits);
158 void collect_set_sink(
struct collect_conn *c,
int should_be_sink);
160 int collect_depth(
struct collect_conn *c);
161 const linkaddr_t *collect_parent(
struct collect_conn *c);
163 void collect_set_keepalive(
struct collect_conn *c, clock_time_t period);
165 void collect_print_stats(
void);
167 #define COLLECT_MAX_DEPTH (COLLECT_LINK_ESTIMATE_UNIT * 64 - 1)
Linked list manipulation routines.
Header file for the packetqueue module
Neighbor discovery header file
#define LIST_STRUCT(name)
Declare a linked list inside a structure declaraction.
Header file for the announcement primitive
Reliable unicast header file
Header file for the callback timer
Representation of a packet queue.
Header file for the Contiki radio neighborhood management
Representation of an announcement.