22#ifndef NET_GNRC_LWMAC_TYPES_H
23#define NET_GNRC_LWMAC_TYPES_H
36#define GNRC_LWMAC_EVENT_RTT_TYPE (0x4300)
41#define GNRC_LWMAC_EVENT_RTT_START (0x4301)
46#define GNRC_LWMAC_EVENT_RTT_STOP (0x4302)
51#define GNRC_LWMAC_EVENT_RTT_PAUSE (0x4303)
56#define GNRC_LWMAC_EVENT_RTT_RESUME (0x4304)
61#define GNRC_LWMAC_EVENT_RTT_WAKEUP_PENDING (0x4305)
66#define GNRC_LWMAC_EVENT_RTT_SLEEP_PENDING (0x4306)
71#define GNRC_LWMAC_EVENT_TIMEOUT_TYPE (0x4400)
78#define GNRC_LWMAC_DUTYCYCLE_ACTIVE (0x01)
86#define GNRC_LWMAC_NEEDS_RESCHEDULE (0x02)
91#define GNRC_LWMAC_RADIO_IS_ON (0x04)
100#ifndef CONFIG_GNRC_LWMAC_TIMEOUT_COUNT
101#define CONFIG_GNRC_LWMAC_TIMEOUT_COUNT (3U)
140#define GNRC_LWMAC_TX_STATE_INITIAL GNRC_LWMAC_TX_STATE_STOPPED
159#define GNRC_LWMAC_RX_STATE_INITIAL GNRC_LWMAC_RX_STATE_STOPPED
164#define GNRC_LWMAC_PHASE_UNINITIALIZED (0)
169#define GNRC_LWMAC_PHASE_MAX (-1)
204#if (GNRC_MAC_ENABLE_DUTYCYCLE_RECORD == 1)
206 uint32_t last_radio_on_time_ticks;
207 uint32_t radio_off_time_ticks;
208 uint32_t system_start_time_ticks;
209 uint32_t awake_duration_sum_ticks;
210 uint32_t pkt_start_sending_time_ticks;
#define CONFIG_GNRC_LWMAC_TIMEOUT_COUNT
The default largest number of parallel timeouts in LWMAC.
bool expired
If type != DISABLED, this indicates if timeout has expired.
gnrc_lwmac_timeout_type_t type
timeout type
xtimer_t timer
xtimer entity
LWMAC specific structure for storing internal states.
uint32_t last_wakeup
Used to calculate wakeup times.
gnrc_lwmac_timeout_t timeouts[CONFIG_GNRC_LWMAC_TIMEOUT_COUNT]
Store timeouts used for protocol.
uint8_t lwmac_info
LWMAC's internal information (flags)
gnrc_lwmac_state_t state
Internal state of MAC layer.
Describes a message object which can be sent between threads.
gnrc_lwmac_state_t
Internal states of LWMAC.
@ GNRC_LWMAC_STATE_COUNT
Count of LWMAC's states.
@ GNRC_LWMAC_UNDEF
Undefined state of LWMAC.
@ GNRC_LWMAC_STOPPED
LWMAC's main state machine has been stopped.
@ GNRC_LWMAC_START
Start LWMAC's main state machine.
@ GNRC_LWMAC_STOP
Stop LWMAC's main state machine.
@ GNRC_LWMAC_TRANSMITTING
TX is handled in own state machine.
@ GNRC_LWMAC_SLEEPING
Turn off radio to conserve power.
@ GNRC_LWMAC_RECEIVING
RX is handled in own state machine.
@ GNRC_LWMAC_LISTENING
Listen the channel for receiving packets.
@ GNRC_LWMAC_RESET
Reset LWMAC's main state machine.
gnrc_lwmac_timeout_type_t
LWMAC timeout types.
@ GNRC_LWMAC_TIMEOUT_WAIT_DEST_WAKEUP
Timeout for waiting receiver's wake-up phase.
@ GNRC_LWMAC_TIMEOUT_WR
WR timeout, waiting WA.
@ GNRC_LWMAC_TIMEOUT_DATA
Timeout awaiting data packet from receiver.
@ GNRC_LWMAC_TIMEOUT_DISABLED
Timeout is disabled.
@ GNRC_LWMAC_TIMEOUT_NEXT_BROADCAST
Timeout for waiting to send the next broadcast packet.
@ GNRC_LWMAC_TIMEOUT_NO_RESPONSE
Maximum WR duration timeout awaiting WA.
@ GNRC_LWMAC_TIMEOUT_WAKEUP_PERIOD
Wake up period timeout for going to sleep.
@ GNRC_LWMAC_TIMEOUT_BROADCAST_END
Timeout awaiting the end of the whole broadcast period.
gnrc_lwmac_tx_state_t
TX states of LWMAC.
@ GNRC_LWMAC_TX_STATE_SEND_DATA
Send the actual payload data.
@ GNRC_LWMAC_TX_STATE_INIT
Initiate transmission.
@ GNRC_LWMAC_TX_STATE_WAIT_WR_SENT
Wait until WR sent to set timeout.
@ GNRC_LWMAC_TX_STATE_SUCCESSFUL
Transmission has finished successfully.
@ GNRC_LWMAC_TX_STATE_FAILED
Payload data couldn't be delivered to dest.
@ GNRC_LWMAC_TX_STATE_STOPPED
Tx schedule stopped, stop sending packet.
@ GNRC_LWMAC_TX_STATE_SEND_WR
Send a wakeup request.
@ GNRC_LWMAC_TX_STATE_WAIT_FOR_WA
Wait for dest node's wakeup ackknowledge.
@ GNRC_LWMAC_TX_STATE_WAIT_FEEDBACK
Wait if packet was ACKed.
@ GNRC_LWMAC_TX_STATE_SEND_BROADCAST
directly goes to SUCCESSFUL or FAILED when finished
gnrc_lwmac_rx_state_t
RX states of LWMAC.
@ GNRC_LWMAC_RX_STATE_INIT
Initiate reception.
@ GNRC_LWMAC_RX_STATE_WAIT_WA_SENT
Wait until WA sent to set timeout.
@ GNRC_LWMAC_RX_STATE_WAIT_FOR_WR
Wait for a wakeup request.
@ GNRC_LWMAC_RX_STATE_SEND_WA
Send wakeup ackknowledge to requesting node.
@ GNRC_LWMAC_RX_STATE_SUCCESSFUL
Recption has finished successfully.
@ GNRC_LWMAC_RX_STATE_STOPPED
Rx schedule stopped.
@ GNRC_LWMAC_RX_STATE_WAIT_FOR_DATA
Wait for actual payload data.
@ GNRC_LWMAC_RX_STATE_FAILED
Reception over, but nothing received.
struct lwmac gnrc_lwmac_t
LWMAC specific structure for storing internal states.
xtimer interface definitions