BA / Mbed OS BaBoRo_test2
Embed: (wiki syntax)

« Back to documentation index

lorawan_data_structures.h File Reference

lorawan_data_structures.h File Reference

Contains common data structures used by Mbed-OS LoRaWAN mplementation. More...

Go to the source code of this file.

Data Structures

union  dr_range_t
struct  dr_range_t::sFields
struct  channel_params_t
struct  band_t
struct  rx2_channel_params
struct  lora_mac_system_params_t
struct  multicast_params_s
union  loramac_mhdr_t
struct  loramac_mhdr_t::hdr_bits_s
union  loramac_frame_ctrl_t
struct  loramac_frame_ctrl_t::ctrl_bits_s
union  loramac_flags_t
struct  loramac_flags_t::mac_flag_bits_s
struct  loramac_mcps_confirm_t
struct  loramac_mcps_indication_t
struct  mlme_join_req_t
struct  mlme_cw_tx_mode_t
struct  loramac_mlme_confirm_t
struct  loramac_mlme_indication_t
struct  loramac_primitives_t
struct  lorawan_connect_otaa_t
 The lorawan_connect_otaa structure. More...
struct  lorawan_connect_abp_t
 The lorawan_connect_abp structure. More...
struct  loramac_tx_message_t
 Stack level TX message structure. More...
union  rx_message_u
 lora_mac_rx_message_by_type_t union More...
struct  loramac_rx_message_t
 loramac_rx_message_t More...
struct  lora_channels_s
 Structure to hold A list of LoRa Channels DO NOT MODIFY, WILL BREAK THE API! More...
struct  lorawan_connect
 lorawan_connect_t structure More...
struct  lorawan_session
 LoRaWAN session. More...
struct  loramac_uplink_status_t
 Structure containing the uplink status. More...
struct  loramac_downlink_status_t
 A structure containing the downlink status. More...
struct  rx_config_params_t
struct  timer_event_t
 Timer object description. More...
struct  lora_channelplan
 DO NOT MODIFY, WILL BREAK THE API! More...
struct  compliance_test
 LoRaWAN compliance tests support data. More...

Typedefs

typedef uint32_t lorawan_time_t
 Timer time variable definition.
typedef struct multicast_params_s multicast_params_t
typedef enum lorawan_status lorawan_status_t
 LoRaMAC status.
typedef enum lorawan_connect_type lorawan_connect_type_t
 Enum of LoRaWAN connection type.
typedef struct lora_channels_s loramac_channel_t
 Structure to hold A list of LoRa Channels DO NOT MODIFY, WILL BREAK THE API!
typedef struct lorawan_connect lorawan_connect_t
 lorawan_connect_t structure
typedef struct lorawan_session lorawan_session_t
 LoRaWAN session.
typedef enum lora_events lorawan_event_t
 LoRaWAN callback functions.
typedef struct lora_channelplan lorawan_channelplan_t
 DO NOT MODIFY, WILL BREAK THE API!
typedef struct compliance_test compliance_test_t
 LoRaWAN compliance tests support data.

Enumerations

enum  device_class_t { CLASS_A, CLASS_B, CLASS_C }
enum  rx_slot_t { RX_SLOT_WIN_1, RX_SLOT_WIN_2, RX_SLOT_WIN_CLASS_C, RX_SLOT_WIN_PING_SLOT }
enum  mac_frame_type_t {
  FRAME_TYPE_JOIN_REQ = 0x00, FRAME_TYPE_JOIN_ACCEPT = 0x01, FRAME_TYPE_DATA_UNCONFIRMED_UP = 0x02, FRAME_TYPE_DATA_UNCONFIRMED_DOWN = 0x03,
  FRAME_TYPE_DATA_CONFIRMED_UP = 0x04, FRAME_TYPE_DATA_CONFIRMED_DOWN = 0x05, FRAME_TYPE_RFU = 0x06, FRAME_TYPE_PROPRIETARY = 0x07
}
enum  mote_mac_cmds_t {
  MOTE_MAC_LINK_CHECK_REQ = 0x02, MOTE_MAC_LINK_ADR_ANS = 0x03, MOTE_MAC_DUTY_CYCLE_ANS = 0x04, MOTE_MAC_RX_PARAM_SETUP_ANS = 0x05,
  MOTE_MAC_DEV_STATUS_ANS = 0x06, MOTE_MAC_NEW_CHANNEL_ANS = 0x07, MOTE_MAC_RX_TIMING_SETUP_ANS = 0x08, MOTE_MAC_TX_PARAM_SETUP_ANS = 0x09,
  MOTE_MAC_DL_CHANNEL_ANS = 0x0A
}
enum  server_mac_cmds_t {
  SRV_MAC_LINK_CHECK_ANS = 0x02, SRV_MAC_LINK_ADR_REQ = 0x03, SRV_MAC_DUTY_CYCLE_REQ = 0x04, SRV_MAC_RX_PARAM_SETUP_REQ = 0x05,
  SRV_MAC_DEV_STATUS_REQ = 0x06, SRV_MAC_NEW_CHANNEL_REQ = 0x07, SRV_MAC_RX_TIMING_SETUP_REQ = 0x08, SRV_MAC_TX_PARAM_SETUP_REQ = 0x09,
  SRV_MAC_DL_CHANNEL_REQ = 0x0A
}
enum  device_battery_level_t { BAT_LEVEL_EXT_SRC = 0x00, BAT_LEVEL_EMPTY = 0x01, BAT_LEVEL_FULL = 0xFE, BAT_LEVEL_NO_MEASURE = 0xFF }
enum  loramac_event_info_status_t {
  LORAMAC_EVENT_INFO_STATUS_OK = 0, LORAMAC_EVENT_INFO_STATUS_ERROR, LORAMAC_EVENT_INFO_STATUS_TX_TIMEOUT, LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT,
  LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT, LORAMAC_EVENT_INFO_STATUS_RX1_ERROR, LORAMAC_EVENT_INFO_STATUS_RX2_ERROR, LORAMAC_EVENT_INFO_STATUS_JOIN_FAIL,
  LORAMAC_EVENT_INFO_STATUS_DOWNLINK_REPEATED, LORAMAC_EVENT_INFO_STATUS_TX_DR_PAYLOAD_SIZE_ERROR, LORAMAC_EVENT_INFO_STATUS_DOWNLINK_TOO_MANY_FRAMES_LOSS, LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL,
  LORAMAC_EVENT_INFO_STATUS_MIC_FAIL, LORAMAC_EVENT_INFO_STATUS_CRYPTO_FAIL
}
enum  mcps_type_t { MCPS_UNCONFIRMED, MCPS_CONFIRMED, MCPS_MULTICAST, MCPS_PROPRIETARY }
 

LoRaMAC data services.

More...
enum  mlme_type_t {
  MLME_JOIN, MLME_LINK_CHECK, MLME_TXCW, MLME_TXCW_1,
  MLME_SCHEDULE_UPLINK
}
 

LoRaMAC management services.

More...
enum  lorawan_status {
  LORAWAN_STATUS_OK = 0, LORAWAN_STATUS_BUSY = -1000, LORAWAN_STATUS_WOULD_BLOCK = -1001, LORAWAN_STATUS_SERVICE_UNKNOWN = -1002,
  LORAWAN_STATUS_PARAMETER_INVALID = -1003, LORAWAN_STATUS_FREQUENCY_INVALID = -1004, LORAWAN_STATUS_DATARATE_INVALID = -1005, LORAWAN_STATUS_FREQ_AND_DR_INVALID = -1006,
  LORAWAN_STATUS_NO_NETWORK_JOINED = -1009, LORAWAN_STATUS_LENGTH_ERROR = -1010, LORAWAN_STATUS_DEVICE_OFF = -1011, LORAWAN_STATUS_NOT_INITIALIZED = -1012,
  LORAWAN_STATUS_UNSUPPORTED = -1013, LORAWAN_STATUS_CRYPTO_FAIL = -1014, LORAWAN_STATUS_PORT_INVALID = -1015, LORAWAN_STATUS_CONNECT_IN_PROGRESS = -1016,
  LORAWAN_STATUS_NO_ACTIVE_SESSIONS = -1017, LORAWAN_STATUS_IDLE = -1018, LORAWAN_STATUS_COMPLIANCE_TEST_ON = -1019
}
 

LoRaMAC status.

More...
enum  lorawan_connect_type { LORAWAN_CONNECTION_OTAA = 0, LORAWAN_CONNECTION_ABP }
 

Enum of LoRaWAN connection type.

More...
enum  rx_msg_type { LORAMAC_RX_MLME_CONFIRM = 0, LORAMAC_RX_MCPS_CONFIRM, LORAMAC_RX_MCPS_INDICATION }
 

lora_mac_rx_message_type_t

More...
enum  loramac_internal_state
enum  lora_events
 

LoRaWAN callback functions.

More...

Detailed Description

Contains common data structures used by Mbed-OS LoRaWAN mplementation.

   ______                              _
  / _____)             _              | |
 ( (____  _____ ____ _| |_ _____  ____| |__
  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
  _____) ) ____| | | || |_| ____( (___| | | |
 (______/|_____)_|_|_| \__)_____)\____)_| |_|
   (C)2013 Semtech
  ___ _____ _   ___ _  _____ ___  ___  ___ ___
 / __|_   _/_\ / __| |/ / __/ _ \| _ \/ __| __|
 \__ \ | |/ _ \ (__| ' <| _| (_) |   / (__| _|
 |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
 embedded.connectivity.solutions===============

Description: LoRa PHY layer

License: Revised BSD License, see LICENSE.TXT file include in the project

Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jaeckle ( STACKFORCE )

Copyright (c) 2017, Arm Limited and affiliates. SPDX-License-Identifier: BSD-3-Clause

Definition in file lorawan_data_structures.h.


Typedef Documentation

LoRaWAN compliance tests support data.

Structure to hold A list of LoRa Channels DO NOT MODIFY, WILL BREAK THE API!

DO NOT MODIFY, WILL BREAK THE API!

lorawan_connect_t structure

A structure representing the parameters for different connections.

Enum of LoRaWAN connection type.

The LoRaWAN connection type specifies how an end-device connects to the gateway.

LoRaWAN callback functions.

LoRaWAN session.

A structure for keeping session details.

LoRaMAC status.

typedef uint32_t lorawan_time_t

Timer time variable definition.

Definition at line 44 of file lorawan_data_structures.h.

LoRaMAC multicast channel parameter.


Enumeration Type Documentation

LoRaMAC battery level indicator.

Enumerator:
BAT_LEVEL_EXT_SRC 

An external power source.

BAT_LEVEL_EMPTY 

Battery level empty.

BAT_LEVEL_FULL 

Battery level full.

BAT_LEVEL_NO_MEASURE 

Battery level - no measurement available.

Definition at line 518 of file lorawan_data_structures.h.

LoRaWAN device classes definition.

LoRaWAN Specification V1.0.2, chapter 2.1.

Enumerator:
CLASS_A 

LoRaWAN device class A.

LoRaWAN Specification V1.0.2, chapter 3.

CLASS_B 

LoRaWAN device class B.

LoRaWAN Specification V1.0.2, chapter 8.

CLASS_C 

LoRaWAN device class C.

LoRaWAN Specification V1.0.2, chapter 17.

Definition at line 122 of file lorawan_data_structures.h.

LoRaWAN callback functions.

Definition at line 1700 of file lorawan_data_structures.h.

The enumeration containing the status of the operation of a MAC service.

Enumerator:
LORAMAC_EVENT_INFO_STATUS_OK 

Service performed successfully.

LORAMAC_EVENT_INFO_STATUS_ERROR 

An error occurred during the execution of the service.

LORAMAC_EVENT_INFO_STATUS_TX_TIMEOUT 

A TX timeout occurred.

LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT 

An RX timeout occurred on receive window 1.

LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT 

An RX timeout occurred on receive window 2.

LORAMAC_EVENT_INFO_STATUS_RX1_ERROR 

An RX error occurred on receive window 1.

LORAMAC_EVENT_INFO_STATUS_RX2_ERROR 

An RX error occurred on receive window 2.

LORAMAC_EVENT_INFO_STATUS_JOIN_FAIL 

An error occurred in the join procedure.

LORAMAC_EVENT_INFO_STATUS_DOWNLINK_REPEATED 

A frame with an invalid downlink counter was received. The downlink counter of the frame was equal to the local copy of the downlink counter of the node.

LORAMAC_EVENT_INFO_STATUS_TX_DR_PAYLOAD_SIZE_ERROR 

The MAC could not retransmit a frame since the MAC decreased the datarate. The payload size is not applicable for the datarate.

LORAMAC_EVENT_INFO_STATUS_DOWNLINK_TOO_MANY_FRAMES_LOSS 

The node has lost MAX_FCNT_GAP or more frames.

LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL 

An address error occurred.

LORAMAC_EVENT_INFO_STATUS_MIC_FAIL 

Message integrity check failure.

LORAMAC_EVENT_INFO_STATUS_CRYPTO_FAIL 

Crypto methods failure

Definition at line 608 of file lorawan_data_structures.h.

LoRaMac internal states

Definition at line 1421 of file lorawan_data_structures.h.

Enum of LoRaWAN connection type.

The LoRaWAN connection type specifies how an end-device connects to the gateway.

Enumerator:
LORAWAN_CONNECTION_OTAA 

Over The Air Activation.

LORAWAN_CONNECTION_ABP 

Activation By Personalization.

Definition at line 1070 of file lorawan_data_structures.h.

LoRaMAC status.

Enumerator:
LORAWAN_STATUS_OK 

Service started successfully.

LORAWAN_STATUS_BUSY 

Service not started - LoRaMAC is busy.

LORAWAN_STATUS_WOULD_BLOCK 

LoRaMAC cannot send at the moment or have nothing to read.

LORAWAN_STATUS_SERVICE_UNKNOWN 

Service unknown.

LORAWAN_STATUS_PARAMETER_INVALID 

Service not started - invalid parameter.

LORAWAN_STATUS_FREQUENCY_INVALID 

Service not started - invalid frequency.

LORAWAN_STATUS_DATARATE_INVALID 

Service not started - invalid datarate.

LORAWAN_STATUS_FREQ_AND_DR_INVALID 

Service not started - invalid frequency and datarate.

LORAWAN_STATUS_NO_NETWORK_JOINED 

Service not started - the device is not in a LoRaWAN.

LORAWAN_STATUS_LENGTH_ERROR 

Service not started - payload lenght error.

LORAWAN_STATUS_DEVICE_OFF 

Service not started - the device is switched off.

LORAWAN_STATUS_NOT_INITIALIZED 

Service not started - stack not initialized.

LORAWAN_STATUS_UNSUPPORTED 

Service not supported.

LORAWAN_STATUS_CRYPTO_FAIL 

Service not started - crypto failure.

LORAWAN_STATUS_PORT_INVALID 

Invalid port.

LORAWAN_STATUS_CONNECT_IN_PROGRESS 

Services started - Connection in progress.

LORAWAN_STATUS_NO_ACTIVE_SESSIONS 

Services not started - No active session.

LORAWAN_STATUS_IDLE 

Services started - Idle at the moment.

LORAWAN_STATUS_COMPLIANCE_TEST_ON 

Compliance test - is on-going.

Definition at line 1005 of file lorawan_data_structures.h.

LoRaMAC frame types.

LoRaWAN Specification V1.0.2, chapter 4.2.1, table 1.

Enumerator:
FRAME_TYPE_JOIN_REQ 

LoRaMAC join request frame.

FRAME_TYPE_JOIN_ACCEPT 

LoRaMAC join accept frame.

FRAME_TYPE_DATA_UNCONFIRMED_UP 

LoRaMAC unconfirmed uplink frame.

FRAME_TYPE_DATA_UNCONFIRMED_DOWN 

LoRaMAC unconfirmed downlink frame.

FRAME_TYPE_DATA_CONFIRMED_UP 

LoRaMAC confirmed uplink frame.

FRAME_TYPE_DATA_CONFIRMED_DOWN 

LoRaMAC confirmed downlink frame.

FRAME_TYPE_RFU 

LoRaMAC RFU frame.

FRAME_TYPE_PROPRIETARY 

LoRaMAC proprietary frame.

Definition at line 392 of file lorawan_data_structures.h.

LoRaMAC data services.

The following table list the primitives supported by a specific MAC data service:

Name | Request | Indication | Response | Confirm --------------------- | :-----: | :--------: | :------: | :-----: MCPS_UNCONFIRMED | YES | YES | NO | YES MCPS_CONFIRMED | YES | YES | NO | YES MCPS_MULTICAST | NO | YES | NO | NO MCPS_PROPRIETARY | YES | YES | NO | YES

The following table provides links to the function implementations of the related MCPS primitives:

Primitive | Function ---------------- | :---------------------: MCPS-Request | LoRaMacMlmeRequest MCPS-Confirm | MacMcpsConfirm in loramac_primitives_t MCPS-Indication | MacMcpsIndication in loramac_primitives_t

Enumerator:
MCPS_UNCONFIRMED 

Unconfirmed LoRaMAC frame.

MCPS_CONFIRMED 

Confirmed LoRaMAC frame.

MCPS_MULTICAST 

Multicast LoRaMAC frame.

MCPS_PROPRIETARY 

Proprietary frame.

Definition at line 733 of file lorawan_data_structures.h.

LoRaMAC management services.

The following table list the primitives supported by a specific MAC management service:

Name | Request | Indication | Response | Confirm ---------------------------- | :-----: | :--------: | :------: | :-----: MLME_JOIN | YES | NO | NO | YES MLME_LINK_CHECK | YES | NO | NO | YES MLME_TXCW | YES | NO | NO | YES MLME_SCHEDULE_UPLINK | NO | YES | NO | NO

The following table provides links to the function implementations of the related MLME primitives.

Primitive | Function ---------------- | :---------------------: MLME-Request | LoRaMacMlmeRequest MLME-Confirm | MacMlmeConfirm in loramac_primitives_t MLME-Indication | MacMlmeIndication in loramac_primitives_t

Enumerator:
MLME_JOIN 

Initiates the Over-the-Air activation.

LoRaWAN Specification V1.0.2, chapter 6.2.

MLME_LINK_CHECK 

LinkCheckReq - Connectivity validation.

LoRaWAN Specification V1.0.2, chapter 5, table 4.

MLME_TXCW 

Sets TX continuous wave mode.

LoRaWAN end-device certification.

MLME_TXCW_1 

Sets TX continuous wave mode (new LoRa-Alliance CC definition).

LoRaWAN end-device certification.

MLME_SCHEDULE_UPLINK 

Indicates that the application shall perform an uplink as soon as possible.

Definition at line 881 of file lorawan_data_structures.h.

LoRaMAC mote MAC commands.

LoRaWAN Specification V1.0.2, chapter 5, table 4.

Enumerator:
MOTE_MAC_LINK_CHECK_REQ 

LinkCheckReq

MOTE_MAC_LINK_ADR_ANS 

LinkADRAns

MOTE_MAC_DUTY_CYCLE_ANS 

DutyCycleAns

MOTE_MAC_RX_PARAM_SETUP_ANS 

RXParamSetupAns

MOTE_MAC_DEV_STATUS_ANS 

DevStatusAns

MOTE_MAC_NEW_CHANNEL_ANS 

NewChannelAns

MOTE_MAC_RX_TIMING_SETUP_ANS 

RXTimingSetupAns

MOTE_MAC_TX_PARAM_SETUP_ANS 

TXParamSetupAns

MOTE_MAC_DL_CHANNEL_ANS 

DlChannelAns

Definition at line 432 of file lorawan_data_structures.h.

lora_mac_rx_message_type_t

An enum representing a structure for RX messages.

Enumerator:
LORAMAC_RX_MLME_CONFIRM 

lora_mac_mlme_confirm_t

LORAMAC_RX_MCPS_CONFIRM 

lora_mac_mcps_confirm_t

LORAMAC_RX_MCPS_INDICATION 

lora_mac_mcps_indication_t

Definition at line 1208 of file lorawan_data_structures.h.

enum rx_slot_t

LoRaMAC receive window enumeration

Enumerator:
RX_SLOT_WIN_1 

LoRaMAC receive window 1

RX_SLOT_WIN_2 

LoRaMAC receive window 2

RX_SLOT_WIN_CLASS_C 

LoRaMAC receive window 2 for class c - continuous listening

RX_SLOT_WIN_PING_SLOT 

LoRaMAC class b ping slot window

Definition at line 254 of file lorawan_data_structures.h.

LoRaMAC server MAC commands.

LoRaWAN Specification V1.0.2 chapter 5, table 4.

Enumerator:
SRV_MAC_LINK_CHECK_ANS 

LinkCheckAns

SRV_MAC_LINK_ADR_REQ 

LinkADRReq

SRV_MAC_DUTY_CYCLE_REQ 

DutyCycleReq

SRV_MAC_RX_PARAM_SETUP_REQ 

RXParamSetupReq

SRV_MAC_DEV_STATUS_REQ 

DevStatusReq

SRV_MAC_NEW_CHANNEL_REQ 

NewChannelReq

SRV_MAC_RX_TIMING_SETUP_REQ 

RXTimingSetupReq

SRV_MAC_TX_PARAM_SETUP_REQ 

NewChannelReq

SRV_MAC_DL_CHANNEL_REQ 

DlChannelReq

Definition at line 476 of file lorawan_data_structures.h.