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
Committer:
ubhat
Date:
Tue Jul 17 22:48:35 2018 +0000
Revision:
11:2426a05fe29e
Parent:
2:14a5d6ad92d5
Child:
8:26002607de9c
Fix bug where FCnt get incremented twice in the case of ADRACKReq with D/L ACK

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mluis 2:14a5d6ad92d5 1 /*!
mluis 2:14a5d6ad92d5 2 * \file LoRaMacTest.h
mluis 2:14a5d6ad92d5 3 *
mluis 2:14a5d6ad92d5 4 * \brief LoRa MAC layer test function implementation
mluis 2:14a5d6ad92d5 5 *
mluis 2:14a5d6ad92d5 6 * \copyright Revised BSD License, see section \ref LICENSE.
mluis 2:14a5d6ad92d5 7 *
mluis 2:14a5d6ad92d5 8 * \code
mluis 2:14a5d6ad92d5 9 * ______ _
mluis 2:14a5d6ad92d5 10 * / _____) _ | |
mluis 2:14a5d6ad92d5 11 * ( (____ _____ ____ _| |_ _____ ____| |__
mluis 2:14a5d6ad92d5 12 * \____ \| ___ | (_ _) ___ |/ ___) _ \
mluis 2:14a5d6ad92d5 13 * _____) ) ____| | | || |_| ____( (___| | | |
mluis 2:14a5d6ad92d5 14 * (______/|_____)_|_|_| \__)_____)\____)_| |_|
mluis 2:14a5d6ad92d5 15 * (C)2013 Semtech
mluis 2:14a5d6ad92d5 16 *
mluis 2:14a5d6ad92d5 17 * ___ _____ _ ___ _ _____ ___ ___ ___ ___
mluis 2:14a5d6ad92d5 18 * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
mluis 2:14a5d6ad92d5 19 * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
mluis 2:14a5d6ad92d5 20 * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
mluis 2:14a5d6ad92d5 21 * embedded.connectivity.solutions===============
mluis 2:14a5d6ad92d5 22 *
mluis 2:14a5d6ad92d5 23 * \endcode
mluis 2:14a5d6ad92d5 24 *
mluis 2:14a5d6ad92d5 25 * \author Miguel Luis ( Semtech )
mluis 2:14a5d6ad92d5 26 *
mluis 2:14a5d6ad92d5 27 * \author Gregory Cristian ( Semtech )
mluis 2:14a5d6ad92d5 28 *
mluis 2:14a5d6ad92d5 29 * \author Daniel Jäckle ( STACKFORCE )
mluis 2:14a5d6ad92d5 30 *
mluis 2:14a5d6ad92d5 31 * \defgroup LORAMACTEST LoRa MAC layer test function implementation
mluis 2:14a5d6ad92d5 32 * This module specifies the API implementation of test function of the LoRaMAC layer.
mluis 2:14a5d6ad92d5 33 * The functions in this file are only for testing purposes only.
mluis 2:14a5d6ad92d5 34 * \{
mluis 2:14a5d6ad92d5 35 */
mluis 2:14a5d6ad92d5 36 #ifndef __LORAMACTEST_H__
mluis 2:14a5d6ad92d5 37 #define __LORAMACTEST_H__
mluis 2:14a5d6ad92d5 38
mluis 2:14a5d6ad92d5 39 /*!
mluis 2:14a5d6ad92d5 40 * \brief Enabled or disables the reception windows
mluis 2:14a5d6ad92d5 41 *
mluis 2:14a5d6ad92d5 42 * \details This is a test function. It shall be used for testing purposes only.
mluis 2:14a5d6ad92d5 43 * Changing this attribute may lead to a non-conformance LoRaMac operation.
mluis 2:14a5d6ad92d5 44 *
mluis 2:14a5d6ad92d5 45 * \param [IN] enable - Enabled or disables the reception windows
mluis 2:14a5d6ad92d5 46 */
mluis 2:14a5d6ad92d5 47 void LoRaMacTestRxWindowsOn( bool enable );
mluis 2:14a5d6ad92d5 48
mluis 2:14a5d6ad92d5 49 /*!
mluis 2:14a5d6ad92d5 50 * \brief Enables the MIC field test
mluis 2:14a5d6ad92d5 51 *
mluis 2:14a5d6ad92d5 52 * \details This is a test function. It shall be used for testing purposes only.
mluis 2:14a5d6ad92d5 53 * Changing this attribute may lead to a non-conformance LoRaMac operation.
mluis 2:14a5d6ad92d5 54 *
mluis 2:14a5d6ad92d5 55 * \param [IN] txPacketCounter - Fixed Tx packet counter value
mluis 2:14a5d6ad92d5 56 */
mluis 2:14a5d6ad92d5 57 void LoRaMacTestSetMic( uint16_t txPacketCounter );
mluis 2:14a5d6ad92d5 58
mluis 2:14a5d6ad92d5 59 /*!
mluis 2:14a5d6ad92d5 60 * \brief Enabled or disables the duty cycle
mluis 2:14a5d6ad92d5 61 *
mluis 2:14a5d6ad92d5 62 * \details This is a test function. It shall be used for testing purposes only.
mluis 2:14a5d6ad92d5 63 * Changing this attribute may lead to a non-conformance LoRaMac operation.
mluis 2:14a5d6ad92d5 64 *
mluis 2:14a5d6ad92d5 65 * \param [IN] enable - Enabled or disables the duty cycle
mluis 2:14a5d6ad92d5 66 */
mluis 2:14a5d6ad92d5 67 void LoRaMacTestSetDutyCycleOn( bool enable );
mluis 2:14a5d6ad92d5 68
mluis 2:14a5d6ad92d5 69 /*! \} defgroup LORAMACTEST */
mluis 2:14a5d6ad92d5 70
mluis 2:14a5d6ad92d5 71 #endif // __LORAMACTEST_H__