GNRC LoRaWAN stack implementation. More...

Detailed Description

GNRC LoRaWAN stack implementation.

Modules

 GNRC LoRaWAN compile configurations
 

Files

file  region.h
 GNRC LoRaWAN region specific functions.
 
file  lorawan.h
 GNRC LoRaWAN API definition.
 
file  gnrc_lorawan_internal.h
 GNRC LoRaWAN internal header.
 

Data Structures

struct  mlme_mib_t
 MAC Information Base descriptor for MLME Request-Confirm. More...
 
struct  mlme_request_t
 MAC (sub) Layer Management Entity (MLME) request representation. More...
 
struct  mcps_request_t
 Mac Common Part Sublayer (MCPS) request representation. More...
 
struct  mlme_confirm_t
 MAC (sub) Layer Management Entity (MLME) confirm representation. More...
 
struct  mcps_confirm_t
 Mac Common Part Sublayer (MCPS) confirm representation. More...
 
struct  mcps_indication_t
 Mac Common Part Sublayer (MCPS) indication representation. More...
 
struct  mlme_indication_t
 MAC (sub) Layer Management Entity (MLME) indication representation. More...
 

Macros

#define GNRC_LORAWAN_REQ_STATUS_SUCCESS   (0)
 MLME or MCPS request successful status.
 
#define GNRC_LORAWAN_REQ_STATUS_DEFERRED   (1)
 the MLME or MCPS confirm message is asynchronous
 

Enumerations

enum  mcps_event_t { MCPS_EVENT_RX, MCPS_EVENT_NO_RX, MCPS_EVENT_ACK_TIMEOUT }
 MCPS events. More...
 
enum  mlme_activation_t { MLME_ACTIVATION_NONE, MLME_ACTIVATION_ABP, MLME_ACTIVATION_OTAA }
 LoRaWAN activation mechanism. More...
 
enum  mlme_mib_type_t { MIB_ACTIVATION_METHOD }
 MAC Information Base attributes. More...
 
enum  mlme_type_t {
  MLME_JOIN, MLME_LINK_CHECK, MLME_RESET, MLME_SET,
  MLME_GET, MLME_SCHEDULE_UPLINK
}
 MLME primitive types. More...
 
enum  mcps_type_t { MCPS_CONFIRMED, MCPS_UNCONFIRMED }
 MCPS primitive types. More...
 

Functions

void gnrc_lorawan_event_timeout (gnrc_lorawan_t *mac)
 Indicate the MAC layer there was a timeout event. More...
 
void gnrc_lorawan_event_tx_complete (gnrc_lorawan_t *mac)
 Indicate the MAC layer when the transmission finished. More...
 
void gnrc_lorawan_init (gnrc_lorawan_t *mac, uint8_t *nwkskey, uint8_t *appskey)
 Init GNRC LoRaWAN. More...
 
void gnrc_lorawan_mlme_request (gnrc_lorawan_t *mac, const mlme_request_t *mlme_request, mlme_confirm_t *mlme_confirm)
 Perform a MLME request. More...
 
void gnrc_lorawan_mcps_request (gnrc_lorawan_t *mac, const mcps_request_t *mcps_request, mcps_confirm_t *mcps_confirm)
 Perform a MCPS request. More...
 
void gnrc_lorawan_recv (gnrc_lorawan_t *mac)
 Fetch a LoRaWAN packet from the radio. More...
 
void gnrc_lorawan_setup (gnrc_lorawan_t *mac, netdev_t *lower)
 Setup GNRC LoRaWAN netdev layers. More...
 

Enumeration Type Documentation

◆ mcps_event_t

MCPS events.

Enumerator
MCPS_EVENT_RX 

MCPS RX event.

MCPS_EVENT_NO_RX 

MCPS no RX event.

MCPS_EVENT_ACK_TIMEOUT 

MCPS retrans event.

Definition at line 63 of file lorawan.h.

◆ mcps_type_t

MCPS primitive types.

Enumerator
MCPS_CONFIRMED 

confirmed data

MCPS_UNCONFIRMED 

unconfirmed data

Definition at line 100 of file lorawan.h.

◆ mlme_activation_t

LoRaWAN activation mechanism.

Enumerator
MLME_ACTIVATION_NONE 

MAC layer is not activated.

MLME_ACTIVATION_ABP 

MAC layer activated by ABP.

MLME_ACTIVATION_OTAA 

MAC layer activated by OTAA.

Definition at line 72 of file lorawan.h.

◆ mlme_mib_type_t

MAC Information Base attributes.

Enumerator
MIB_ACTIVATION_METHOD 

type is activation method

Definition at line 81 of file lorawan.h.

◆ mlme_type_t

MLME primitive types.

Enumerator
MLME_JOIN 

join a LoRaWAN network

MLME_LINK_CHECK 

perform a Link Check

MLME_RESET 

reset the MAC layer

MLME_SET 

set the MIB

MLME_GET 

get the MIB

MLME_SCHEDULE_UPLINK 

schedule uplink indication

Definition at line 88 of file lorawan.h.

Function Documentation

◆ gnrc_lorawan_event_timeout()

void gnrc_lorawan_event_timeout ( gnrc_lorawan_t mac)

Indicate the MAC layer there was a timeout event.

Parameters
[in]macpointer to the MAC descriptor

◆ gnrc_lorawan_event_tx_complete()

void gnrc_lorawan_event_tx_complete ( gnrc_lorawan_t mac)

Indicate the MAC layer when the transmission finished.

Parameters
[in]macpointer to the MAC descriptor

◆ gnrc_lorawan_init()

void gnrc_lorawan_init ( gnrc_lorawan_t mac,
uint8_t *  nwkskey,
uint8_t *  appskey 
)

Init GNRC LoRaWAN.

Parameters
[in]macpointer to the MAC descriptor
[in]nwkskeybuffer to store the NwkSKey. Should be at least 16 bytes long
[in]appskeybuffer to store the AppsKey. Should be at least 16 bytes long

◆ gnrc_lorawan_mcps_request()

void gnrc_lorawan_mcps_request ( gnrc_lorawan_t mac,
const mcps_request_t mcps_request,
mcps_confirm_t mcps_confirm 
)

Perform a MCPS request.

Parameters
[in]macpointer to the MAC descriptor
[in]mcps_requestthe MCPS request
[out]mcps_confirmthe MCPS confirm. mlme_confirm->status could either be GNRC_LORAWAN_REQ_STATUS_SUCCESS if the request was OK, GNRC_LORAWAN_REQ_STATUS_DEFERRED if the confirmation is deferred or an standard error number

◆ gnrc_lorawan_mlme_request()

void gnrc_lorawan_mlme_request ( gnrc_lorawan_t mac,
const mlme_request_t mlme_request,
mlme_confirm_t mlme_confirm 
)

Perform a MLME request.

Parameters
[in]macpointer to the MAC descriptor
[in]mlme_requestthe MLME request
[out]mlme_confirmthe MLME confirm. mlme_confirm->status could either be GNRC_LORAWAN_REQ_STATUS_SUCCESS if the request was OK, GNRC_LORAWAN_REQ_STATUS_DEFERRED if the confirmation is deferred or an standard error number

◆ gnrc_lorawan_recv()

void gnrc_lorawan_recv ( gnrc_lorawan_t mac)

Fetch a LoRaWAN packet from the radio.

To be called on radio RX done event.

Parameters
[in]macpointer to the MAC descriptor

◆ gnrc_lorawan_setup()

void gnrc_lorawan_setup ( gnrc_lorawan_t mac,
netdev_t lower 
)

Setup GNRC LoRaWAN netdev layers.

Parameters
macpointer to the MAC descriptor
lowerpointer to the lower netdev device (radio)