#include <sys/types.h>
#include <cc/mac.h>
Defines | |
#define | BMAC_DEBUG(str,) {} |
Functions | |
void | bmac_cmds_register_cmds (void) |
void | bmac_disable_timer_interrupt (int disable_timer) |
void | bmac_enable_led (int enable_led) |
u_char | bmac_get_ack (void) |
u_short | bmac_get_address (void) |
u_short | bmac_get_mtu (void) |
int | bmac_init (u_short address) |
int | bmac_receive (u_short *src, u_short *dst, u_char *data, u_short *data_length, u_long ms) |
int | bmac_send (u_short dst, u_char *data, u_short data_len) |
void | bmac_set_ack (u_char enable_ack) |
void | bmac_set_congestion_backoff (u_char max_duration) |
void | bmac_set_initial_backoff (u_char max_duration) |
void | bmac_set_lpl_interval (u_short interval) |
void | bmac_use_interrupt_to_send (int use_irq) |
Variables | |
u_long | bmac_failed_count |
mac_interface_t | bmac_interface |
u_long | bmac_recv_count |
#define BMAC_DEBUG | ( | str | ) | {} |
define this if debug output should be printed
void bmac_cmds_register_cmds | ( | void | ) |
Registers some B-MAC related btnode terminal-commands.
void bmac_disable_timer_interrupt | ( | int | disable_timer | ) |
Enables/disables the deactivation of the timer interrupt while sending.
disable_timer | [in] true (1) to enable or false (0) to disable the deactivation mechanism |
void bmac_enable_led | ( | int | enable_led | ) |
Enables/disables led feedback.
enable_led | [in] true (1) to enable or false (0) to disable led feedback |
u_char bmac_get_ack | ( | void | ) |
Queries the status pf the automatic acknowledgments of unicast packets.
u_short bmac_get_address | ( | void | ) |
Returns the configured mac address.
u_short bmac_get_mtu | ( | void | ) |
Returns the maximal payload size of a B-MAC packet.
int bmac_init | ( | u_short | address | ) |
Initialises the B-MAC library.
address | [in] mac address of the node |
Receives a B-MAC packet.
src | [out] source address | |
dst | [out] destination address | |
data | [out] payload of the packet | |
data_length | [in] maximal size of the payload [out] actual size of the payload | |
ms | [in] maximal duration (in ms) to wait for a packet |
Sends a B-MAC packet.
dst | [in] destination address | |
data | [in] payload of the packet | |
data_len | [in] payload size |
void bmac_set_ack | ( | u_char | enable_ack | ) |
Enables/disables the automatic acknowledgment of unicast packets.
enable_ack | [in] true (1) to enable or false (0) to disable automatic acknowledgments |
void bmac_set_congestion_backoff | ( | u_char | max_duration | ) |
Sets the maximal duration of the congestion backoff.
max_duration | [in] maximal congestion backoff-time |
void bmac_set_initial_backoff | ( | u_char | max_duration | ) |
Sets the maximal duration of the initial backoff.
max_duration | [in] maximal initial backoff-time |
void bmac_set_lpl_interval | ( | u_short | interval | ) |
Sets the duration of a LPL interval. If the interval is set to zero, LPL is disabled and the radio is permanently on.
interval | [in] duration of the interval in ms |
void bmac_use_interrupt_to_send | ( | int | use_irq | ) |
Enables/disables the usage of the SPI interrupt for sending.
use_irq | [in] true (1) to enable the usage of the SPI interrupt or false (0) to use busy-waiting |
MAC-Interface