Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Stubborn best-effort local area broadcast

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.

Data Structures

struct  stbroadcast_callbacks
 
struct  stbroadcast_conn
 A stbroadcast connection. More...
 

Files

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

 

Functions

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

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.

void stbroadcast_close ( struct stbroadcast_conn c)
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.

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.
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.