Contiki 2.6

Anonymous best-effort local area broadcast

The abc module sends packets to all local area neighbors. More...

Data Structures

struct  abc_callbacks
 Callback structure for abc. More...

Files

file  abc.c
 

Anonymous best-effort local area Broad Cast (abc)


file  abc.h
 

Header file for the Rime module Anonymous BroadCast (abc)


Functions

void abc_open (struct abc_conn *c, uint16_t channel, const struct abc_callbacks *u)
 Set up an anonymous best-effort broadcast connection.
void abc_close (struct abc_conn *c)
 Close an abc connection.
int abc_send (struct abc_conn *c)
 Send an anonymous best-effort broadcast packet.
void abc_input (struct channel *channel)
 Internal Rime function: Pass a packet to the abc layer.

Detailed Description

The abc module sends packets to all local area neighbors.

The abc module adds no headers to outgoing packets.

Channels

The abc module uses 1 channel.


Function Documentation

void abc_close ( struct abc_conn *  c)

Close an abc connection.

Parameters:
cA pointer to a struct abc_conn

This function closes an abc connection that has previously been opened with abc_open().

This function typically is called as an exit handler.

Definition at line 75 of file abc.c.

Referenced by broadcast_close(), and polite_close().

void abc_input ( struct channel *  channel)

Internal Rime function: Pass a packet to the abc layer.

This function is used internally by Rime to pass packets to the abc layer. Should never be called directly.

Definition at line 90 of file abc.c.

References rimeaddr_node_addr.

void abc_open ( struct abc_conn *  c,
uint16_t  channel,
const struct abc_callbacks u 
)

Set up an anonymous best-effort broadcast connection.

Parameters:
cA pointer to a struct abc_conn
channelThe channel on which the connection will operate
uA struct abc_callbacks with function pointers to functions that will be called when a packet has been received

This function sets up an abc connection on the specified channel. The caller must have allocated the memory for the struct abc_conn, usually by declaring it as a static variable.

The struct abc_callbacks pointer must point to a structure containing a pointer to a function that will be called when a packet arrives on the channel.

Definition at line 66 of file abc.c.

Referenced by broadcast_open(), and polite_open().

int abc_send ( struct abc_conn *  c)

Send an anonymous best-effort broadcast packet.

Parameters:
cThe abc connection on which the packet should be sent
Return values:
Non-zeroif the packet could be sent, zero otherwise

This function sends an anonymous best-effort broadcast packet. The packet must be present in the packetbuf before this function is called.

The parameter c must point to an abc connection that must have previously been set up with abc_open().

Definition at line 81 of file abc.c.

References rimeaddr_node_addr.

Referenced by broadcast_send().