Skip to content

Commit

Permalink
Added possibility to override LORAWAN_DEFAULT_CLASS
Browse files Browse the repository at this point in the history
  • Loading branch information
mluis1 committed May 21, 2021
1 parent 2a983e1 commit 8697eae
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/apps/LoRaMac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ set(SUB_PROJECT_LIST periodic-uplink-lpp fuota-test-01)
set(SUB_PROJECT periodic-uplink-lpp CACHE STRING "Default sub project is periodic-uplink-lpp")
set_property(CACHE SUB_PROJECT PROPERTY STRINGS ${SUB_PROJECT_LIST})

# Allow LORAWAN_DEFAULT_CLASS overriding for periodic-uplink-lpp project
if(SUB_PROJECT STREQUAL periodic-uplink-lpp)
set(LORAWAN_DEFAULT_CLASS_LIST CLASS_A CLASS_B CLASS_C)
set(LORAWAN_DEFAULT_CLASS CLASS_A CACHE STRING "Default LoRaWAN class is ClassA")
set_property(CACHE LORAWAN_DEFAULT_CLASS PROPERTY STRINGS ${LORAWAN_DEFAULT_CLASS_LIST})
endif()

# Allow switching of active region
set(ACTIVE_REGION_LIST LORAMAC_REGION_EU868 LORAMAC_REGION_US915 LORAMAC_REGION_CN779
LORAMAC_REGION_EU433 LORAMAC_REGION_AU915 LORAMAC_REGION_AS923 LORAMAC_REGION_CN470
Expand Down Expand Up @@ -124,6 +131,9 @@ add_executable(${PROJECT_NAME}-${SUB_PROJECT}

target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE $<$<BOOL:${CLASSB_ENABLED}>:LORAMAC_CLASSB_ENABLED>)
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE ACTIVE_REGION=${ACTIVE_REGION})
if(SUB_PROJECT STREQUAL periodic-uplink-lpp)
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE LORAWAN_DEFAULT_CLASS=${LORAWAN_DEFAULT_CLASS})
endif()
if(${SECURE_ELEMENT_PRE_PROVISIONED} MATCHES ON)
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE -DSECURE_ELEMENT_PRE_PROVISIONED)
endif()
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/NAMote72/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/NucleoL073/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/NucleoL152/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/NucleoL476/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/SAMR34/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/SKiM880B/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/SKiM881AXL/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down
2 changes: 2 additions & 0 deletions src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
/*!
* LoRaWAN default end-device class
*/
#ifndef LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_CLASS CLASS_A
#endif

/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
Expand Down

0 comments on commit 8697eae

Please sign in to comment.