1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net/lorawan : Invert 'LORAMAC_DEFAULT_PUBLIC_NETWORK'

Introduced a bool 'LORAMAC_DEFAULT_PRIVATE_NETWORK' to invert
the semantics of 'LORAMAC_DEFAULT_PUBLIC_NETWORK'. Move
'LORAMAC_DEFAULT_PRIVATE_NETWORK' to 'CONFIG_' namespace.
This commit is contained in:
Akshai M 2020-11-20 15:20:06 +01:00
parent 3c5c429541
commit 1befae9022
3 changed files with 29 additions and 3 deletions

View File

@ -29,6 +29,7 @@
#include "msg.h"
#include "mutex.h"
#include "kernel_defines.h"
#include "net/netdev.h"
#include "net/netdev/lora.h"

View File

@ -125,12 +125,35 @@ extern "C" {
#define CONFIG_LORAMAC_DEFAULT_NETID (1U)
#endif
/**
* @brief Toggle network type (public or private)
*
* Set "1" to enable private network, set "0" to enable public network.
* This configuration sets the sync word for LoRaWAN communication. This should
* be in concordance with the gateway configuration. Public networks use `0x34`
* while private networks use `0x12` as sync word.
*/
#ifdef DOXYGEN
#define CONFIG_LORAMAC_DEFAULT_PRIVATE_NETWORK
#endif
/**
* @brief Default network type (public or private)
*
* This configuration sets the sync word for LoRaWAN communication. This should
* be in concordance with the gateway configuration. Public networks use `0x34`
* while private networks use `0x12` as sync word.
* @deprecated Use inverse @ref CONFIG_LORAMAC_DEFAULT_PRIVATE_NETWORK instead.
* Will be removed after 2021.04 release.
*/
#ifndef LORAMAC_DEFAULT_PUBLIC_NETWORK
#define LORAMAC_DEFAULT_PUBLIC_NETWORK (true)
#if IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_PRIVATE_NETWORK)
#define LORAMAC_DEFAULT_PUBLIC_NETWORK (false)
#else
#define LORAMAC_DEFAULT_PUBLIC_NETWORK (true)
#endif
#endif
/**
* @brief Default datarate
*/

View File

@ -17,11 +17,13 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "errno.h"
#include "kernel_defines.h"
#include "net/lora.h"
#include "net/gnrc/lorawan.h"
#include "errno.h"
#include "net/gnrc/pktbuf.h"
#include "net/lorawan/hdr.h"
#include "net/loramac.h"
#include "net/gnrc/lorawan/region.h"