summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Miermont <smiermont@semtech.com>2014-06-27 16:14:32 +0200
committerSylvain Miermont <smiermont@semtech.com>2014-06-27 16:14:32 +0200
commita39d133560cbb617557bb912f0c188bab73055fd (patch)
tree5f75f60547bb7c9946f893e38654f9286e2fccbe
parent5b962da815a502559a27c3d283c22a0a943f23bb (diff)
downloadlora_gateway-a39d133560cbb617557bb912f0c188bab73055fd.tar.gz
lora_gateway-a39d133560cbb617557bb912f0c188bab73055fd.tar.bz2
lora_gateway-a39d133560cbb617557bb912f0c188bab73055fd.zip
v1.5.0v1.5.0
- Adding option to discriminate LoRa MAC networks from private LoRa networks at PHY level.
-rw-r--r--VERSION2
-rw-r--r--libloragw/Makefile15
-rw-r--r--libloragw/library.cfg7
-rw-r--r--libloragw/src/loragw_hal.c35
-rw-r--r--readme.md4
5 files changed, 57 insertions, 6 deletions
diff --git a/VERSION b/VERSION
index 13175fd..3e1ad72 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.4.1 \ No newline at end of file
+1.5.0 \ No newline at end of file
diff --git a/libloragw/Makefile b/libloragw/Makefile
index 1e2d872..f6ba783 100644
--- a/libloragw/Makefile
+++ b/libloragw/Makefile
@@ -98,6 +98,18 @@ else
CFG_BRD_OPT := CFG_BRD_NONE
endif
+ifeq ($(CFG_NET),private)
+ CFG_NET_MSG := Private network
+ CFG_NET_OPT := CFG_NET_PRIVATE
+else ifeq ($(CFG_NET),lora_mac)
+ CFG_NET_MSG := LoRa MAC network
+ CFG_NET_OPT := CFG_NET_LORAMAC
+else
+ $(warning [Warning] No network type selected, assume private network by default.)
+ CFG_NET_MSG := Private network
+ CFG_NET_OPT := CFG_NET_PRIVATE
+endif
+
### linking options
ifeq ($(CFG_SPI),native)
@@ -142,6 +154,9 @@ inc/config.h: ../VERSION library.cfg
# Board misc. parameters
@echo "Board misc. param : $(CFG_BRD_MSG)"
@echo " #define $(CFG_BRD_OPT) 1" >> $@
+ # Network type
+ @echo "Network type : $(CFG_NET_MSG)"
+ @echo " #define $(CFG_NET_OPT) 1" >> $@
# Debug options
@echo " #define DEBUG_AUX $(DEBUG_AUX)" >> $@
@echo " #define DEBUG_SPI $(DEBUG_SPI)" >> $@
diff --git a/libloragw/library.cfg b/libloragw/library.cfg
index 34e31bb..1db5195 100644
--- a/libloragw/library.cfg
+++ b/libloragw/library.cfg
@@ -45,6 +45,13 @@ CFG_BAND= eu868
CFG_BRD= ref_1301_868
+### Network Type ###
+# Accepted values:
+# private Default
+# lora_mac Only compliant with devices running LoRa MAC
+
+CFG_NET= private
+
### Debug options ###
# Set the DEBUG_* to 1 to activate debug mode in individual modules.
# Warning: that makes the module *very verbose*, do not use for production
diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c
index 5f7d141..2acef58 100644
--- a/libloragw/src/loragw_hal.c
+++ b/libloragw/src/loragw_hal.c
@@ -332,8 +332,16 @@ typedef struct {
#define CFG_BRD_STR "brd?"
#endif
+#if (CFG_NET_PRIVATE == 1)
+ #define CFG_NET_STR "private"
+#elif (CFG_NET_LORAMAC == 1)
+ #define CFG_NET_STR "lora_mac"
+#else
+ #define CFG_NET_STR "network?"
+#endif
+
/* Version string, used to identify the library version/options once compiled */
-const char lgw_version_string[] = "Version: " LIBLORAGW_VERSION "; Options: " CFG_SPI_STR " " CFG_CHIP_STR " " CFG_RADIO_STR " " CFG_BAND_STR " " CFG_BRD_STR ";";
+const char lgw_version_string[] = "Version: " LIBLORAGW_VERSION "; Options: " CFG_SPI_STR " " CFG_CHIP_STR " " CFG_RADIO_STR " " CFG_BAND_STR " " CFG_BRD_STR " " CFG_NET_STR ";";
/* -------------------------------------------------------------------------- */
/* --- PRIVATE VARIABLES ---------------------------------------------------- */
@@ -642,8 +650,13 @@ void lgw_constant_adjust(void) {
// lgw_reg_w(LGW_SYNCH_DETECT_TH,1); /* default 1 */
// lgw_reg_w(LGW_ZERO_PAD,0); /* default 0 */
lgw_reg_w(LGW_SNR_AVG_CST,3); /* default 2 */
- // lgw_reg_w(LGW_FRAME_SYNCH_PEAK1_POS,1); /* default 1 */
- // lgw_reg_w(LGW_FRAME_SYNCH_PEAK2_POS,2); /* default 2 */
+ #if (CFG_NET_LORAMAC == 1)
+ lgw_reg_w(LGW_FRAME_SYNCH_PEAK1_POS,3); /* default 1 */
+ lgw_reg_w(LGW_FRAME_SYNCH_PEAK2_POS,4); /* default 2 */
+ #elif (CFG_NET_PRIVATE == 1)
+ //lgw_reg_w(LGW_FRAME_SYNCH_PEAK1_POS,1); /* default 1 */
+ //lgw_reg_w(LGW_FRAME_SYNCH_PEAK2_POS,2); /* default 2 */
+ #endif
// lgw_reg_w(LGW_PREAMBLE_FINE_TIMING_GAIN,1); /* default 1 */
// lgw_reg_w(LGW_ONLY_CRC_EN,1); /* default 1 */
// lgw_reg_w(LGW_PAYLOAD_FINE_TIMING_GAIN,2); /* default 2 */
@@ -658,8 +671,13 @@ void lgw_constant_adjust(void) {
// lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_GAIN,1); /* default 1 */
// lgw_reg_w(LGW_MBWSSF_SYNCH_DETECT_TH,1); /* default 1 */
// lgw_reg_w(LGW_MBWSSF_ZERO_PAD,0); /* default 0 */
- // lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK1_POS,1); /* default 1 */
- // lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK2_POS,2); /* default 2 */
+ #if (CFG_NET_LORAMAC == 1)
+ lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK1_POS,3); /* default 1 */
+ lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK2_POS,4); /* default 2 */
+ #elif (CFG_NET_PRIVATE == 1)
+ //lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK1_POS,1); /* default 1 */
+ //lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK2_POS,2); /* default 2 */
+ #endif
// lgw_reg_w(LGW_MBWSSF_ONLY_CRC_EN,1); /* default 1 */
// lgw_reg_w(LGW_MBWSSF_PAYLOAD_FINE_TIMING_GAIN,2); /* default 2 */
// lgw_reg_w(LGW_MBWSSF_PREAMBLE_FINE_TIMING_GAIN,1); /* default 1 */
@@ -692,6 +710,13 @@ void lgw_constant_adjust(void) {
/* TX LoRa */
// lgw_reg_w(LGW_TX_MODE,0); /* default 0 */
lgw_reg_w(LGW_TX_SWAP_IQ,1); /* "normal" polarity; default 0 */
+ #if (CFG_NET_LORAMAC == 1)
+ lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK1_POS,3); /* default 1 */
+ lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK2_POS,4); /* default 2 */
+ #elif (CFG_NET_PRIVATE == 1)
+ //lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK1_POS,1); /* default 1 */
+ //lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK2_POS,2); /* default 2 */
+ #endif
/* TX FSK */
// lgw_reg_w(LGW_FSK_TX_GAUSSIAN_EN,1); /* default 1 */
diff --git a/readme.md b/readme.md
index 654a499..1d46a5a 100644
--- a/readme.md
+++ b/readme.md
@@ -56,6 +56,10 @@ gateways as receivers.
3. Changelog
-------------
+### v1.5.0 ###
+
+* Adding option to discriminate LoRa MAC networks from private LoRa networks at PHY level.
+
### v1.4.1 ###
* Enabling support for FSK per LoRa MAC specification