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:
2:14a5d6ad92d5
Child:
7:c16969e0f70f
--- a/LoRaMac-api-v3.h	Mon Mar 14 09:09:54 2016 +0000
+++ b/LoRaMac-api-v3.h	Fri May 13 14:51:50 2016 +0000
@@ -41,15 +41,23 @@
 #define BEACON_INTERVAL                             128000000
 
 /*!
- * Class A&B receive delay in us
+ * Class A&B receive delay 1 in us
  */
 #define RECEIVE_DELAY1                              1000000
+
+/*!
+ * Class A&B receive delay 2 in us
+ */
 #define RECEIVE_DELAY2                              2000000
 
 /*!
- * Join accept receive delay in us
+ * Join accept receive delay 1 in us
  */
 #define JOIN_ACCEPT_DELAY1                          5000000
+
+/*!
+ * Join accept receive delay 2 in us
+ */
 #define JOIN_ACCEPT_DELAY2                          6000000
 
 /*!
@@ -75,19 +83,19 @@
 /*!
  * Number of seconds after the start of the second reception window without
  * receiving an acknowledge.
- * AckTimeout = ACK_TIMEOUT + Random( -ACK_TIMEOUT_RND, ACK_TIMEOUT_RND )
+ * AckTimeout = \ref ACK_TIMEOUT + Random( -\ref ACK_TIMEOUT_RND, \ref ACK_TIMEOUT_RND )
  */
 #define ACK_TIMEOUT                                 2000000
 
 /*!
  * Random number of seconds after the start of the second reception window without
  * receiving an acknowledge
- * AckTimeout = ACK_TIMEOUT + Random( -ACK_TIMEOUT_RND, ACK_TIMEOUT_RND )
+ * AckTimeout = \ref ACK_TIMEOUT + Random( -\ref ACK_TIMEOUT_RND, \ref ACK_TIMEOUT_RND )
  */
 #define ACK_TIMEOUT_RND                             1000000
 
 /*!
- * Check the Mac layer state every MAC_STATE_CHECK_TIMEOUT
+ * Check the Mac layer state every MAC_STATE_CHECK_TIMEOUT in us
  */
 #define MAC_STATE_CHECK_TIMEOUT                     1000000
 
@@ -97,14 +105,18 @@
 #define MAX_ACK_RETRIES                             8
 
 /*!
- * RSSI free threshold
+ * RSSI free threshold [dBm]
  */
-#define RSSI_FREE_TH                                ( int8_t )( -90 ) // [dBm]
+#define RSSI_FREE_TH                                ( int8_t )( -90 )
 
 /*!
- * Frame direction definition
+ * Frame direction definition for up-link communications
  */
 #define UP_LINK                                     0
+
+/*!
+ * Frame direction definition for down-link communications
+ */
 #define DOWN_LINK                                   1
 
 /*!