71 #define COLLECT_PACKET_ID_BITS 8
73 #define COLLECT_ATTRIBUTES { PACKETBUF_ADDR_ESENDER, PACKETBUF_ADDRSIZE }, \
74 { PACKETBUF_ATTR_EPACKET_ID, PACKETBUF_ATTR_BIT * COLLECT_PACKET_ID_BITS }, \
75 { PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_BIT * COLLECT_PACKET_ID_BITS }, \
76 { PACKETBUF_ATTR_TTL, PACKETBUF_ATTR_BIT * 4 }, \
77 { PACKETBUF_ATTR_HOPS, PACKETBUF_ATTR_BIT * 4 }, \
78 { PACKETBUF_ATTR_MAX_REXMIT, PACKETBUF_ATTR_BIT * 5 }, \
79 { PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_BIT }, \
82 struct collect_callbacks {
83 void (* recv)(
const rimeaddr_t *originator, uint8_t seqno,
90 #ifndef COLLECT_CONF_ANNOUNCEMENTS
91 #define COLLECT_ANNOUNCEMENTS 1
93 #define COLLECT_ANNOUNCEMENTS COLLECT_CONF_ANNOUNCEMENTS
97 struct unicast_conn unicast_conn;
98 #if ! COLLECT_ANNOUNCEMENTS
99 struct neighbor_discovery_conn neighbor_discovery_conn;
102 struct ctimer transmit_after_scan_timer;
104 const struct collect_callbacks *cb;
105 struct ctimer retransmission_timer;
108 struct collect_neighbor_list neighbor_list;
110 struct ctimer keepalive_timer;
111 clock_time_t keepalive_period;
113 struct ctimer proactive_probing_timer;
115 rimeaddr_t parent, current_parent;
118 uint8_t sending, transmissions, max_rexmits;
122 clock_time_t send_time;
130 void collect_open(
struct collect_conn *c, uint16_t channels,
132 const struct collect_callbacks *callbacks);
133 void collect_close(
struct collect_conn *c);
135 int collect_send(
struct collect_conn *c,
int rexmits);
137 void collect_set_sink(
struct collect_conn *c,
int should_be_sink);
139 int collect_depth(
struct collect_conn *c);
140 const rimeaddr_t *collect_parent(
struct collect_conn *c);
142 void collect_set_keepalive(
struct collect_conn *c, clock_time_t period);
144 void collect_print_stats(
void);
146 #define COLLECT_MAX_DEPTH (COLLECT_LINK_ESTIMATE_UNIT * 64 - 1)