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:
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
Diff: LoRaMacCrypto.cpp
- Revision:
- 2:14a5d6ad92d5
- Parent:
- 1:91e4e6c60d1e
--- a/LoRaMacCrypto.cpp Mon Nov 23 10:09:43 2015 +0000 +++ b/LoRaMacCrypto.cpp Tue Jan 05 16:41:54 2016 +0000 @@ -5,12 +5,17 @@ _____) ) ____| | | || |_| ____( (___| | | | (______/|_____)_|_|_| \__)_____)\____)_| |_| (C)2013 Semtech + ___ _____ _ ___ _ _____ ___ ___ ___ ___ +/ __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| +\__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| +|___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| +embedded.connectivity.solutions=============== Description: LoRa MAC layer implementation License: Revised BSD License, see LICENSE.TXT file include in the project -Maintainer: Miguel Luis and Gregory Cristian +Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jäckle ( STACKFORCE ) */ #include <stdlib.h> #include <stdint.h> @@ -185,13 +190,13 @@ memset1( nonce, 0, sizeof( nonce ) ); nonce[0] = 0x01; - LoRaMacMemCpy( appNonce, nonce + 1, 6 ); - LoRaMacMemCpy( pDevNonce, nonce + 7, 2 ); + memcpy1( nonce + 1, appNonce, 6 ); + memcpy1( nonce + 7, pDevNonce, 2 ); aes_encrypt( nonce, nwkSKey, &AesContext ); memset1( nonce, 0, sizeof( nonce ) ); nonce[0] = 0x02; - LoRaMacMemCpy( appNonce, nonce + 1, 6 ); - LoRaMacMemCpy( pDevNonce, nonce + 7, 2 ); + memcpy1( nonce + 1, appNonce, 6 ); + memcpy1( nonce + 7, pDevNonce, 2 ); aes_encrypt( nonce, appSKey, &AesContext ); }