46 #include "contiki-net.h"
49 static const struct packetbuf_attrlist attributes[] =
51 BROADCAST_ATTRIBUTES PACKETBUF_ATTR_LAST
57 #define PRINTF(...) printf(__VA_ARGS__)
64 recv_from_abc(
struct abc_conn *bc)
67 struct broadcast_conn *c = (
struct broadcast_conn *)bc;
69 rimeaddr_copy(&sender, packetbuf_addr(PACKETBUF_ADDR_SENDER));
71 PRINTF(
"%d.%d: broadcast: from %d.%d\n",
73 sender.u8[0], sender.u8[1]);
74 c->u->recv(c, &sender);
78 sent_by_abc(
struct abc_conn *bc,
int status,
int num_tx)
80 struct broadcast_conn *c = (
struct broadcast_conn *)bc;
82 PRINTF(
"%d.%d: sent to %d.%d status %d num_tx %d\n",
84 packetbuf_addr(PACKETBUF_ADDR_SENDER)->u8[0],
85 packetbuf_addr(PACKETBUF_ADDR_SENDER)->u8[1],
88 c->u->sent(c, status, num_tx);
92 static const struct abc_callbacks broadcast = {recv_from_abc, sent_by_abc};
98 abc_open(&c->c, channel, &broadcast);
100 channel_set_attributes(channel, attributes);
112 PRINTF(
"%d.%d: broadcast_send\n",