Contiki 2.5
Files | Data Structures | Functions
Stubborn best-effort local area broadcast

The stbroadcast module provides stubborn anonymous best-effort local area broadcast. More...

Files

file  stbroadcast.c
 
    Implementation of the Rime module Stubborn Anonymous
    BroadCast (stbroadcast)

 
file  stbroadcast.h
 
    Header file for the Rime module Stubborn Anonymous BroadCast (stbroadcast)

 

Data Structures

struct  stbroadcast_conn
 A stbroadcast connection. More...
 

Functions

void stbroadcast_open (struct stbroadcast_conn *c, uint16_t channel, const struct stbroadcast_callbacks *u)
 Set up a stbroadcast connection. More...
 
void stbroadcast_set_timer (struct stbroadcast_conn *c, clock_time_t t)
 Set the retransmission time of the current stubborn message. More...
 
int stbroadcast_send_stubborn (struct stbroadcast_conn *c, clock_time_t t)
 Send a stubborn message. More...
 
void stbroadcast_cancel (struct stbroadcast_conn *c)
 Cancel the current stubborn message. More...
 

Detailed Description

The stbroadcast module provides stubborn anonymous best-effort local area broadcast.

A message sent with the stbroadcast module is repeated until either the message is canceled or a new message is sent. Messages sent with the stbroadcast module are not identified with a sender ID.

Channels

The stbroadcast module uses 1 channel.

Function Documentation

void stbroadcast_cancel ( struct stbroadcast_conn c)

Cancel the current stubborn message.

Parameters
cA stbroadcast connection that must have been previously set up with stbroadcast_open()

This function cancels a stubborn message that has previously been sent with the stbroadcast_send_stubborn() function.

Definition at line 116 of file stbroadcast.c.

References ctimer_stop().

void stbroadcast_open ( struct stbroadcast_conn c,
uint16_t  channel,
const struct stbroadcast_callbacks *  u 
)

Set up a stbroadcast connection.

Parameters
cA pointer to a user-supplied struct stbroadcast variable.
channelThe Rime channel on which messages should be sent.
uPointer to the upper layer functions that should be used for this connection.

This function sets up a stbroadcast connection on the specified channel. No checks are made if the channel is currently used by another connection.

This function must be called before any other function that operates on the connection is called.

Definition at line 65 of file stbroadcast.c.

References broadcast_open().

int stbroadcast_send_stubborn ( struct stbroadcast_conn c,
clock_time_t  t 
)

Send a stubborn message.

Parameters
cA stbroadcast connection that must have been previously set up with stbroadcast_open()
tThe time between message retransmissions.
        This function sends a message from the Rime buffer. The
        message must have been previously constructed in the
        Rime buffer. When this function returns, the message
        has been copied into a queue buffer.

        If another message has previously been sent, the old
        message is canceled.

Definition at line 100 of file stbroadcast.c.

References NULL, and stbroadcast_set_timer().

void stbroadcast_set_timer ( struct stbroadcast_conn c,
clock_time_t  t 
)

Set the retransmission time of the current stubborn message.

Parameters
cA stbroadcast connection that must have been previously set up with stbroadcast_open()
tThe new time between message retransmissions.
        This function sets the retransmission timer for the
        current stubborn message to a new value.

Definition at line 94 of file stbroadcast.c.

References ctimer_set().

Referenced by stbroadcast_send_stubborn().