Go to the documentation of this file.
21 #ifndef LWMAC_INTERNAL_H
22 #define LWMAC_INTERNAL_H
44 #define GNRC_LWMAC_TX_CONTINUE (0x0008U)
56 #define GNRC_LWMAC_QUIT_TX (0x0010U)
68 #define GNRC_LWMAC_PHASE_BACKOFF (0x0020U)
81 #define GNRC_LWMAC_QUIT_RX (0x0040U)
98 #define GNRC_LWMAC_RTT_EVENT_MARGIN_TICKS (RTT_MS_TO_TICKS(2))
374 return (uint32_t)tmp;
int _gnrc_lwmac_dispatch_defer(gnrc_pktsnip_t *buffer[], gnrc_pktsnip_t *pkt)
Store the received packet to the dispatch buffer and remove possible duplicate packets.
static void gnrc_lwmac_set_reschedule(gnrc_netif_t *netif, bool reschedule)
set the GNRC_LWMAC_NEEDS_RESCHEDULE flag of LWMAC
static void gnrc_lwmac_set_quit_rx(gnrc_netif_t *netif, bool quit_rx)
set the GNRC_LWMAC_QUIT_RX flag of the device
gnrc_netif_mac_t mac
Common MAC module component
static bool gnrc_lwmac_get_quit_tx(gnrc_netif_t *netif)
get the GNRC_LWMAC_QUIT_TX flag of the device
#define assert(cond)
abort the program if assertion is false
static void gnrc_lwmac_set_dutycycle_active(gnrc_netif_t *netif, bool active)
set the GNRC_LWMAC_DUTYCYCLE_ACTIVE flag of LWMAC
int _gnrc_lwmac_transmit(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
send a packet over the network interface in LWMAC
static bool gnrc_lwmac_get_quit_rx(gnrc_netif_t *netif)
get the GNRC_LWMAC_QUIT_RX flag of the device
gnrc_lwmac_hdr_t * header
LWMAC header of packet.
Type to pass information about parsing.
#define GNRC_LWMAC_DUTYCYCLE_ACTIVE
LWMAC duty-cycle active flag.
Low-level RTT (Real Time Timer) peripheral driver interface definitions.
Internal data types used by GNRC_MAC.
#define GNRC_LWMAC_PHASE_BACKOFF
Flag to track if the device need to reselect a new wake-up phase.
static uint32_t _gnrc_lwmac_ticks_to_phase(uint32_t ticks)
Convert RTT ticks to device phase.
netopt_state_t
Option parameter to be used with NETOPT_STATE to set or get the state of a network device or protocol...
static bool gnrc_lwmac_get_dutycycle_active(gnrc_netif_t *netif)
get the GNRC_LWMAC_DUTYCYCLE_ACTIVE flag of LWMAC
#define GNRC_LWMAC_QUIT_RX
Flag to track if the device needs to quit the wake-up (listening) procedure.
Representation of a network interface.
void _gnrc_lwmac_set_netdev_state(gnrc_netif_t *netif, netopt_state_t devstate)
Shortcut to set the state of netdev.
static void gnrc_lwmac_set_quit_tx(gnrc_netif_t *netif, bool quit_tx)
set the GNRC_LWMAC_QUIT_TX flag of the device
static void gnrc_lwmac_set_phase_backoff(gnrc_netif_t *netif, bool backoff)
set the GNRC_LWMAC_PHASE_BACKOFF flag of the device
#define RTT_US_TO_TICKS(us)
Convert microseconds to rtt ticks.
LWMAC internal L2 address structure.
static bool gnrc_lwmac_get_reschedule(gnrc_netif_t *netif)
get the GNRC_LWMAC_NEEDS_RESCHEDULE flag of LWMAC
uint16_t mac_info
general information for the MAC protocol
gnrc_lwmac_l2_addr_t dst_addr
copied destination address of packet
static bool gnrc_lwmac_get_tx_continue(gnrc_netif_t *netif)
get the GNRC_LWMAC_TX_CONTINUE flag of the device
uint32_t rtt_get_counter(void)
Get the current RTT counter.
#define GNRC_LWMAC_NEEDS_RESCHEDULE
LWMAC needs reschedule flag.
Definition for GNRC's network interfaces.
#define GNRC_LWMAC_TX_CONTINUE
Flag to track if the sender can continue to transmit packet to the receiver in its TX procedure.
static void gnrc_lwmac_set_tx_continue(gnrc_netif_t *netif, bool tx_continue)
set the GNRC_LWMAC_TX_CONTINUE flag of the device
#define CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US
Time between consecutive wake-ups.
int _gnrc_lwmac_parse_packet(gnrc_pktsnip_t *pkt, gnrc_lwmac_packet_info_t *info)
Parse an incoming packet and extract important information.
static uint32_t _gnrc_lwmac_phase_now(void)
Get device's current phase.
static bool gnrc_lwmac_get_phase_backoff(gnrc_netif_t *netif)
get the GNRC_LWMAC_PHASE_BACKOFF flag of the device
#define GNRC_LWMAC_QUIT_TX
Flag to track if the sender should quit Tx in current cycle.
Type to represent parts (either headers or payload) of a packet, called snips.
Definition of internal types used by LWMAC.
gnrc_lwmac_l2_addr_t src_addr
copied source address of packet
static uint32_t _gnrc_lwmac_ticks_until_phase(uint32_t phase)
Calculate how many ticks remaining to the targeted phase in the future.
netopt_state_t _gnrc_lwmac_get_netdev_state(gnrc_netif_t *netif)
Shortcut to get the state of netdev.