47 #include "lib/random.h"
52 #define MAX(a,b) ((a) > (b)? (a) : (b))
56 #define MIN(a, b) ((a) < (b)? (a) : (b))
62 recv(
struct abc_conn *abc)
84 sent(
struct abc_conn *c,
int status,
int num_tx)
95 queuebuf_to_packetbuf(c->q);
133 c->hdrsize = hdrsize;
134 c->q = queuebuf_new_from_packetbuf();
int abc_send(struct abc_conn *c)
Send an anonymous best-effort broadcast packet.
int polite_send(struct polite_conn *c, clock_time_t interval, uint8_t hdrsize)
Send a packet on a polite connection.
void(* dropped)(struct polite_conn *c)
Called when a packet is dropped because a packet was heard from a neighbor.
#define NULL
The null pointer.
void(* recv)(struct ipolite_conn *c, const linkaddr_t *from)
Called when a packet is received on the connection.
Header file for the Rime stack
Header file for Polite Anonymous best effort local Broadcast (polite)
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
void polite_open(struct polite_conn *c, uint16_t channel, const struct polite_callbacks *cb)
Open a polite connection.
void ctimer_set(struct ctimer *c, clock_time_t t, void(*f)(void *), void *ptr)
Set a callback timer.
void(* sent)(struct polite_conn *c)
Called when a packet is sent on the connection.
An opaque structure with no user-visible elements that holds the state of a polite connection...
void(* recv)(struct abc_conn *ptr)
Called when a packet has been received by the abc module.
void polite_cancel(struct polite_conn *c)
Cancel a pending packet.
void abc_close(struct abc_conn *c)
Close an abc connection.
void abc_open(struct abc_conn *c, uint16_t channelno, const struct abc_callbacks *callbacks)
Set up an anonymous best-effort broadcast connection.
void polite_close(struct polite_conn *c)
Close a polite connection.
void(* recv)(struct polite_conn *c)
Called when a packet is received on the connection.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
A structure with callback functions for a polite connection.
void ctimer_stop(struct ctimer *c)
Stop a pending callback timer.
unsigned short random_rand(void)
Generate the next state and return the upper part of it.
Callback structure for abc.