LoRaWAN MAC layer implementation

Dependents:   LoRaWAN-demo-72_tjm LoRaWAN-demo-72_jlc LoRaWAN-demo-elmo frdm_LoRa_Connect_Woodstream_Demo_tjm ... more

LoRAWAN-lib is a port of the GitHub LoRaMac-node LoRaWAN MAC layer implementation.

This library depends on the SX1276Lib or SX1272Lib radio drivers depending on the used mbed component shield.

This library depends also on some cryptographic helper functions as well as helper functions for the timers management. These can be found on the example projects under the system directory.

The example projects are:

  1. LoRaWAN-demo-72
  2. LoRaWAN-demo-76
  3. LoRaWAN-demo-NAMote72

The LoRaWAN specification specifies different ISM bands operating parameters. These are all implemented under the LoRaMac-board.h file.

In order to select which band to use, please change line 24 of board.h file provided on the examples projects as follows:


EU868

board.h

#define USE_BAND_868


US915

board.h

#define USE_BAND_915


US915 - Hybrid

board.h

#define USE_BAND_915_HYBRID


CN780

board.h

#define USE_BAND_780


EU433

board.h

#define USE_BAND_433
Revision:
4:37c12dbc8dc7
Parent:
3:b9d87593a8ae
Child:
7:c16969e0f70f
--- a/LoRaMac.h	Mon Mar 14 09:09:54 2016 +0000
+++ b/LoRaMac.h	Fri May 13 14:51:50 2016 +0000
@@ -480,6 +480,9 @@
      * Byte-access to the bits
      */
     uint8_t Value;
+    /*!
+     * Structure containing single access to bits
+     */
     struct sCtrlBits
     {
         /*!
@@ -541,6 +544,10 @@
      */
     LORAMAC_EVENT_INFO_STATUS_DOWNLINK_REPEATED,
     /*!
+     * The node has lost MAX_FCNT_GAP or more frames.
+     */
+    LORAMAC_EVENT_INFO_STATUS_DOWNLINK_TOO_MANY_FRAMES_LOSS,
+    /*!
      * An address error occured
      */
     LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL,
@@ -559,6 +566,9 @@
      * Byte-access to the bits
      */
     uint8_t Value;
+    /*!
+     * Structure containing single access to bits
+     */
     struct sMacFlagBits
     {
         /*!
@@ -910,7 +920,7 @@
 }MlmeReqJoin_t;
 
 /*!
- *
+ * LoRaMAC MLME-Request structure
  */
 typedef struct sMlmeReq
 {
@@ -985,9 +995,10 @@
  * \ref MIB_JOIN_ACCEPT_DELAY_1      | YES | YES
  * \ref MIB_JOIN_ACCEPT_DELAY_2      | YES | YES
  * \ref MIB_CHANNELS_DATARATE        | YES | YES
+ * \ref MIB_CHANNELS_DEFAULT_DATARATE| YES | YES
  * \ref MIB_CHANNELS_TX_POWER        | YES | YES
- * \ref MIB_UPLINK_COUNTER           | YES | NO
- * \ref MIB_DOWNLINK_COUNTER         | YES | NO
+ * \ref MIB_UPLINK_COUNTER           | YES | YES
+ * \ref MIB_DOWNLINK_COUNTER         | YES | YES
  * \ref MIB_MULTICAST_CHANNEL        | YES | NO
  *
  * The following table provides links to the function implementations of the
@@ -1117,6 +1128,16 @@
      */
     MIB_JOIN_ACCEPT_DELAY_2,
     /*!
+     * Default Data rate of a channel
+     *
+     * LoRaWAN Specification V1.0, chapter 7
+     *
+     * EU868 - [DR_0, DR_1, DR_2, DR_3, DR_4, DR_5, DR_6, DR_7]
+     *
+     * US915 - [DR_0, DR_1, DR_2, DR_3, DR_4, DR_8, DR_9, DR_10, DR_11, DR_12, DR_13]
+     */
+    MIB_CHANNELS_DEFAULT_DATARATE,
+    /*!
      * Data rate of a channel
      *
      * LoRaWAN Specification V1.0, chapter 7
@@ -1276,6 +1297,12 @@
     /*!
      * Channels data rate
      *
+     * Related MIB type: \ref MIB_CHANNELS_DEFAULT_DATARATE
+     */
+    int8_t ChannelsDefaultDatarate;
+    /*!
+     * Channels data rate
+     *
      * Related MIB type: \ref MIB_CHANNELS_DATARATE
      */
     int8_t ChannelsDatarate;