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:
1:91e4e6c60d1e
Parent:
0:91d1a7783bb9
Child:
2:14a5d6ad92d5
--- a/system/utilities.cpp	Tue Oct 20 13:21:26 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- / _____)             _              | |
-( (____  _____ ____ _| |_ _____  ____| |__
- \____ \| ___ |    (_   _) ___ |/ ___)  _ \
- _____) ) ____| | | || |_| ____( (___| | | |
-(______/|_____)_|_|_| \__)_____)\____)_| |_|
-    (C)2013 Semtech
-
-Description: Helper functions implementation
-
-License: Revised BSD License, see LICENSE.TXT file include in the project
-
-Maintainer: Miguel Luis and Gregory Cristian
-*/
-#include <stdlib.h>
-#include <stdio.h>
-#include "board.h"
-#include "utilities.h"
-
-/*!
- * Redefinition of rand() and srand() standard C functions.
- * These functions are redefined in order to get the same behavior across
- * different compiler toolchains implementations.
- */
-// Standard random functions redefinition start
-#define RAND_LOCAL_MAX 2147483647
-
-static unsigned long next = 1;
-
-int rand1( void )
-{
-    return ( ( next = next * 1103515245 + 12345 ) % RAND_LOCAL_MAX );
-}
-
-void srand1( unsigned int seed )
-{
-    next = seed;
-}
-// Standard random functions redefinition end
-
-int32_t randr( int32_t min, int32_t max )
-{
-    return ( int32_t )rand1( ) % ( max - min + 1 ) + min;
-}
-
-void memcpy1( uint8_t *dst, const uint8_t *src, uint16_t size )
-{
-    while( size-- )
-    {
-        *dst++ = *src++;
-    }
-}
-
-void memset1( uint8_t *dst, uint8_t value, uint16_t size )
-{
-    while( size-- )
-    {
-        *dst++ = value;
-    }
-}
-
-int8_t Nibble2HexChar( uint8_t a )
-{
-    if( a < 10 )
-    {
-        return '0' + a;
-    }
-    else if( a < 16 )
-    {
-        return 'A' + ( a - 10 );
-    }
-    else
-    {
-        return '?';
-    }
-}