The stbroadcast module provides stubborn anonymous best-effort local area broadcast. More...
Data Structures | |
struct | stbroadcast_conn |
A stbroadcast connection. 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). | |
Functions | |
void | stbroadcast_open (struct stbroadcast_conn *c, uint16_t channel, const struct stbroadcast_callbacks *u) |
Set up a stbroadcast connection. | |
void | stbroadcast_set_timer (struct stbroadcast_conn *c, clock_time_t t) |
Set the retransmission time of the current stubborn message. | |
int | stbroadcast_send_stubborn (struct stbroadcast_conn *c, clock_time_t t) |
Send a stubborn message. | |
void | stbroadcast_cancel (struct stbroadcast_conn *c) |
Cancel the current stubborn message. |
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.
The stbroadcast module uses 1 channel.
void stbroadcast_cancel | ( | struct stbroadcast_conn * | c | ) |
Cancel the current stubborn message.
c | A 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_open | ( | struct stbroadcast_conn * | c, | |
uint16_t | channel, | |||
const struct stbroadcast_callbacks * | u | |||
) |
Set up a stbroadcast connection.
c | A pointer to a user-supplied struct stbroadcast variable. | |
channel | The Rime channel on which messages should be sent. | |
u | Pointer 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.
c | A stbroadcast connection that must have been previously set up with stbroadcast_open() | |
t | The 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.
c | A stbroadcast connection that must have been previously set up with stbroadcast_open() | |
t | The new time between message retransmissions. |
This function sets the retransmission timer for the current stubborn message to a new value.