Definition of internal types used by LWMAC.
More...
#include "msg.h"
#include "xtimer.h"
#include "net/gnrc/lwmac/hdr.h"
Go to the source code of this file.
|
typedef struct lwmac | gnrc_lwmac_t |
| LWMAC specific structure for storing internal states.
|
|
|
enum | gnrc_lwmac_state_t {
GNRC_LWMAC_UNDEF = -1
, GNRC_LWMAC_STOPPED
, GNRC_LWMAC_START
, GNRC_LWMAC_STOP
,
GNRC_LWMAC_RESET
, GNRC_LWMAC_LISTENING
, GNRC_LWMAC_RECEIVING
, GNRC_LWMAC_TRANSMITTING
,
GNRC_LWMAC_SLEEPING
, GNRC_LWMAC_STATE_COUNT
} |
| Internal states of LWMAC. More...
|
|
enum | gnrc_lwmac_tx_state_t {
GNRC_LWMAC_TX_STATE_STOPPED
, GNRC_LWMAC_TX_STATE_INIT
, GNRC_LWMAC_TX_STATE_SEND_BROADCAST
, GNRC_LWMAC_TX_STATE_SEND_WR
,
GNRC_LWMAC_TX_STATE_WAIT_WR_SENT
, GNRC_LWMAC_TX_STATE_WAIT_FOR_WA
, GNRC_LWMAC_TX_STATE_SEND_DATA
, GNRC_LWMAC_TX_STATE_WAIT_FEEDBACK
,
GNRC_LWMAC_TX_STATE_SUCCESSFUL
, GNRC_LWMAC_TX_STATE_FAILED
} |
| TX states of LWMAC. More...
|
|
enum | gnrc_lwmac_rx_state_t {
GNRC_LWMAC_RX_STATE_STOPPED
, GNRC_LWMAC_RX_STATE_INIT
, GNRC_LWMAC_RX_STATE_WAIT_FOR_WR
, GNRC_LWMAC_RX_STATE_SEND_WA
,
GNRC_LWMAC_RX_STATE_WAIT_WA_SENT
, GNRC_LWMAC_RX_STATE_WAIT_FOR_DATA
, GNRC_LWMAC_RX_STATE_SUCCESSFUL
, GNRC_LWMAC_RX_STATE_FAILED
} |
| RX states of LWMAC. More...
|
|
enum | gnrc_lwmac_timeout_type_t {
GNRC_LWMAC_TIMEOUT_DISABLED
, GNRC_LWMAC_TIMEOUT_WR
, GNRC_LWMAC_TIMEOUT_NO_RESPONSE
, GNRC_LWMAC_TIMEOUT_DATA
,
GNRC_LWMAC_TIMEOUT_WAIT_DEST_WAKEUP
, GNRC_LWMAC_TIMEOUT_WAKEUP_PERIOD
, GNRC_LWMAC_TIMEOUT_NEXT_BROADCAST
, GNRC_LWMAC_TIMEOUT_BROADCAST_END
} |
| LWMAC timeout types. More...
|
|
#define | GNRC_LWMAC_EVENT_RTT_TYPE (0x4300) |
| LWMAC RTT event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_START (0x4301) |
| LWMAC RTT start event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_STOP (0x4302) |
| LWMAC RTT stop event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_PAUSE (0x4303) |
| LWMAC RTT pause event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_RESUME (0x4304) |
| LWMAC RTT resume event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_WAKEUP_PENDING (0x4305) |
| LWMAC RTT wakeup pending event type.
|
|
#define | GNRC_LWMAC_EVENT_RTT_SLEEP_PENDING (0x4306) |
| LWMAC RTT sleep pending event type.
|
|
#define | GNRC_LWMAC_EVENT_TIMEOUT_TYPE (0x4400) |
| LWMAC timeout event type.
|
|
#define | GNRC_LWMAC_DUTYCYCLE_ACTIVE (0x01) |
| LWMAC duty-cycle active flag.
|
|
#define | GNRC_LWMAC_NEEDS_RESCHEDULE (0x02) |
| LWMAC needs reschedule flag.
|
|
#define | GNRC_LWMAC_RADIO_IS_ON (0x04) |
| LWMAC check radio's on/off state flag.
|
|
#define | CONFIG_GNRC_LWMAC_TIMEOUT_COUNT (3U) |
| The default largest number of parallel timeouts in LWMAC.
|
|
◆ GNRC_LWMAC_DUTYCYCLE_ACTIVE
#define GNRC_LWMAC_DUTYCYCLE_ACTIVE (0x01) |
LWMAC duty-cycle active flag.
Keep track of duty cycling to avoid late RTT events after stopping.
Definition at line 78 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_PAUSE
#define GNRC_LWMAC_EVENT_RTT_PAUSE (0x4303) |
LWMAC RTT pause event type.
Definition at line 51 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_RESUME
#define GNRC_LWMAC_EVENT_RTT_RESUME (0x4304) |
LWMAC RTT resume event type.
Definition at line 56 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_SLEEP_PENDING
#define GNRC_LWMAC_EVENT_RTT_SLEEP_PENDING (0x4306) |
LWMAC RTT sleep pending event type.
Definition at line 66 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_START
#define GNRC_LWMAC_EVENT_RTT_START (0x4301) |
LWMAC RTT start event type.
Definition at line 41 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_STOP
#define GNRC_LWMAC_EVENT_RTT_STOP (0x4302) |
LWMAC RTT stop event type.
Definition at line 46 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_TYPE
#define GNRC_LWMAC_EVENT_RTT_TYPE (0x4300) |
LWMAC RTT event type.
Definition at line 36 of file types.h.
◆ GNRC_LWMAC_EVENT_RTT_WAKEUP_PENDING
#define GNRC_LWMAC_EVENT_RTT_WAKEUP_PENDING (0x4305) |
LWMAC RTT wakeup pending event type.
Definition at line 61 of file types.h.
◆ GNRC_LWMAC_EVENT_TIMEOUT_TYPE
#define GNRC_LWMAC_EVENT_TIMEOUT_TYPE (0x4400) |
LWMAC timeout event type.
Definition at line 71 of file types.h.
◆ GNRC_LWMAC_NEEDS_RESCHEDULE
#define GNRC_LWMAC_NEEDS_RESCHEDULE (0x02) |
LWMAC needs reschedule flag.
Used internally for rescheduling state machine update, e.g. after state transition caused in update.
Definition at line 86 of file types.h.
◆ GNRC_LWMAC_PHASE_MAX
#define GNRC_LWMAC_PHASE_MAX (-1) |
LWMAC max phase value.
Definition at line 169 of file types.h.
◆ GNRC_LWMAC_PHASE_UNINITIALIZED
#define GNRC_LWMAC_PHASE_UNINITIALIZED (0) |
LWMAC uninitialized phase value.
Definition at line 164 of file types.h.
◆ GNRC_LWMAC_RADIO_IS_ON
#define GNRC_LWMAC_RADIO_IS_ON (0x04) |
LWMAC check radio's on/off state flag.
Definition at line 91 of file types.h.
◆ GNRC_LWMAC_RX_STATE_INITIAL
Static initializer for gnrc_lwmac_rx_state_t.
Definition at line 159 of file types.h.
◆ GNRC_LWMAC_TX_STATE_INITIAL
Static initializer for gnrc_lwmac_tx_state_t.
Definition at line 140 of file types.h.
◆ gnrc_lwmac_rx_state_t
RX states of LWMAC.
Enumerator |
---|
GNRC_LWMAC_RX_STATE_STOPPED | Rx schedule stopped.
|
GNRC_LWMAC_RX_STATE_INIT | Initiate reception.
|
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_WAIT_WA_SENT | Wait until WA sent to set timeout.
|
GNRC_LWMAC_RX_STATE_WAIT_FOR_DATA | Wait for actual payload data.
|
GNRC_LWMAC_RX_STATE_SUCCESSFUL | Recption has finished successfully.
|
GNRC_LWMAC_RX_STATE_FAILED | Reception over, but nothing received.
|
Definition at line 145 of file types.h.
◆ gnrc_lwmac_state_t
Internal states of LWMAC.
Enumerator |
---|
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_RESET | Reset LWMAC's main state machine.
|
GNRC_LWMAC_LISTENING | Listen the channel for receiving packets.
|
GNRC_LWMAC_RECEIVING | RX is handled in own state machine.
|
GNRC_LWMAC_TRANSMITTING | TX is handled in own state machine.
|
GNRC_LWMAC_SLEEPING | Turn off radio to conserve power.
|
GNRC_LWMAC_STATE_COUNT | Count of LWMAC's states.
|
Definition at line 108 of file types.h.
◆ gnrc_lwmac_timeout_type_t
LWMAC timeout types.
Enumerator |
---|
GNRC_LWMAC_TIMEOUT_DISABLED | Timeout is disabled.
|
GNRC_LWMAC_TIMEOUT_WR | WR timeout, waiting WA.
|
GNRC_LWMAC_TIMEOUT_NO_RESPONSE | Maximum WR duration timeout awaiting WA.
|
GNRC_LWMAC_TIMEOUT_DATA | Timeout awaiting data packet from receiver.
|
GNRC_LWMAC_TIMEOUT_WAIT_DEST_WAKEUP | Timeout for waiting receiver's wake-up phase.
|
GNRC_LWMAC_TIMEOUT_WAKEUP_PERIOD | Wake up period timeout for going to sleep.
|
GNRC_LWMAC_TIMEOUT_NEXT_BROADCAST | Timeout for waiting to send the next broadcast packet.
|
GNRC_LWMAC_TIMEOUT_BROADCAST_END | Timeout awaiting the end of the whole broadcast period.
|
Definition at line 174 of file types.h.
◆ gnrc_lwmac_tx_state_t
TX states of LWMAC.
Enumerator |
---|
GNRC_LWMAC_TX_STATE_STOPPED | Tx schedule stopped, stop sending packet.
|
GNRC_LWMAC_TX_STATE_INIT | Initiate transmission.
|
GNRC_LWMAC_TX_STATE_SEND_BROADCAST | directly goes to SUCCESSFUL or FAILED when finished
|
GNRC_LWMAC_TX_STATE_SEND_WR | Send a wakeup request.
|
GNRC_LWMAC_TX_STATE_WAIT_WR_SENT | Wait until WR sent to set timeout.
|
GNRC_LWMAC_TX_STATE_WAIT_FOR_WA | Wait for dest node's wakeup ackknowledge.
|
GNRC_LWMAC_TX_STATE_SEND_DATA | Send the actual payload data.
|
GNRC_LWMAC_TX_STATE_WAIT_FEEDBACK | Wait if packet was ACKed.
|
GNRC_LWMAC_TX_STATE_SUCCESSFUL | Transmission has finished successfully.
|
GNRC_LWMAC_TX_STATE_FAILED | Payload data couldn't be delivered to dest.
|
Definition at line 124 of file types.h.