Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
- Adding option to discriminate LoRa MAC networks from private LoRa networks at PHY level.
  • Loading branch information
Sylvain Miermont committed Jun 27, 2014
1 parent 5b962da commit a39d133
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.1
1.5.0
15 changes: 15 additions & 0 deletions libloragw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)" >> $@
Expand Down
7 changes: 7 additions & 0 deletions libloragw/library.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 30 additions & 5 deletions libloragw/src/loragw_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------- */
Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a39d133

Please sign in to comment.