From 5c08cae005f2acf0732dac0602bd5ea93f2a9e0d Mon Sep 17 00:00:00 2001 From: Liu_Weichao Date: Tue, 20 Jun 2023 11:24:15 +0800 Subject: [PATCH] feat add lorawan_gateway_single_channel lib for XiUOS and compile OK --- .gitmodules | 5 ++++- APP_Framework/lib/lorawan/Kconfig | 13 +++++++++++ APP_Framework/lib/lorawan/Makefile | 4 ++++ APP_Framework/lib/lorawan/README.md | 22 ++++++++++++++----- .../lorawan/lorawan_gateway_single_channel | 1 + Ubiquitous/XiZi_IIoT/path_kernel.mk | 4 ++++ 6 files changed, 42 insertions(+), 7 deletions(-) create mode 160000 APP_Framework/lib/lorawan/lorawan_gateway_single_channel diff --git a/.gitmodules b/.gitmodules index 0c1a2eedf..4b15013ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,4 +28,7 @@ [submodule "APP_Framework/lib/lorawan/lorawan_devicenode"] path = APP_Framework/lib/lorawan/lorawan_devicenode url = https://gitlink.org.cn/IACU/lorawan_devicenode.git - branch = master \ No newline at end of file + branch = master +[submodule "APP_Framework/lib/lorawan/lorawan_gateway_single_channel"] + path = APP_Framework/lib/lorawan/lorawan_gateway_single_channel + url = https://gitlink.org.cn/IACU/lorawan_gateway_single_channel.git diff --git a/APP_Framework/lib/lorawan/Kconfig b/APP_Framework/lib/lorawan/Kconfig index ec6f54332..be88cbf5d 100644 --- a/APP_Framework/lib/lorawan/Kconfig +++ b/APP_Framework/lib/lorawan/Kconfig @@ -5,6 +5,18 @@ menuconfig LIB_USING_LORAWAN default n if LIB_USING_LORAWAN + menuconfig LIB_USING_LORAWAN_GATEWAY_SC + help + Please add "source "$APP_DIR/lib/lorawan/lorawan_gateway_single_channel/Kconfig"" when using lorawan_gateway_single_channel + bool "LoRaWan using lorawan_gateway for single channel(SX126x/SX127x) lib" + default n + select LIB_USING_LORA_RADIO + select BSP_USING_LWIP + + if LIB_USING_LORAWAN_GATEWAY_SC + + endif + menuconfig LIB_USING_LORAWAN_ED_STACK help Please add "source "$APP_DIR/lib/lorawan/lorawan_devicenode/Kconfig"" when using lorawan_devicenode @@ -21,6 +33,7 @@ menuconfig LIB_USING_LORAWAN Please add "source "$APP_DIR/lib/lorawan/lora_radio_driver/Kconfig"" when using lora_radio_driver bool "LoRaWan using lora-radio-driver lib" default n + select BSP_USING_SPI if LIB_USING_LORA_RADIO diff --git a/APP_Framework/lib/lorawan/Makefile b/APP_Framework/lib/lorawan/Makefile index dd6c0721f..98b176f19 100644 --- a/APP_Framework/lib/lorawan/Makefile +++ b/APP_Framework/lib/lorawan/Makefile @@ -8,4 +8,8 @@ ifeq ($(CONFIG_LIB_USING_LORAWAN_ED_STACK),y) SRC_DIR += lorawan_devicenode endif +ifeq ($(CONFIG_LIB_USING_LORAWAN_GATEWAY_SC),y) + SRC_DIR += lorawan_gateway_single_channel +endif + include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/lib/lorawan/README.md b/APP_Framework/lib/lorawan/README.md index 7fb6c76e2..8d4b730da 100644 --- a/APP_Framework/lib/lorawan/README.md +++ b/APP_Framework/lib/lorawan/README.md @@ -1,16 +1,17 @@ # lorawan子模块调试说明 -矽璓工业物联操作系统XiUOS目前支持lorawan相关开源库,通过子模块形式管理,该目录主要内容是包含**lora_radio_driver**、**lorawan_devicenode**等。 +矽璓工业物联操作系统XiUOS目前支持lorawan相关开源库,通过子模块形式管理,该目录主要内容是包含**lora_radio_driver**、**lorawan_devicenode**、**lorawan_gateway_single_channel**等。 ## 目录内容 ``` xiuos/APP_Framework/lib/lorawan ├── README.md - ├── lora_radio_driver lora_radio驱动库 - ├── lorawan_devicenode lorawan节点协议栈 - ├── Kconfig lorawan Kconfig配置 - └── Makefile lorawan Makefile + ├── lora_radio_driver lora_radio驱动库 + ├── lorawan_devicenode lorawan节点协议栈 + ├── lorawan_gateway_single_channel lorawan节点协议栈 + ├── Kconfig lorawan Kconfig配置 + └── Makefile lorawan Makefile ``` ## 使用 @@ -24,7 +25,16 @@ git submodule init git submodule update APP_Framework/lib/lorawan/lora_radio_driver git submodule update APP_Framework/lib/lorawan/lorawan_devicenode -# 进入 APP_Framework/lib/lorawan/Kconfig 配置,增加子模块source路径 +# 进入 APP_Framework/lib/lorawan/Kconfig 配置,增加子模块source路径,从而编译时可找到相应lib的配置 +menuconfig LIB_USING_LORAWAN_GATEWAY_SC + bool "LoRaWan using lorawan_gateway for single channel(SX126x、SX127x) lib" + default n + select LIB_USING_LORA_RADIO + +if LIB_USING_LORAWAN_GATEWAY_SC + source "$APP_DIR/lib/lorawan/lorawan_gateway_single_channel/Kconfig" +endif + menuconfig LIB_USING_LORAWAN_ED_STACK bool "LoRaWan using lorawan_ed_stack lib" default n diff --git a/APP_Framework/lib/lorawan/lorawan_gateway_single_channel b/APP_Framework/lib/lorawan/lorawan_gateway_single_channel new file mode 160000 index 000000000..ac1c6516e --- /dev/null +++ b/APP_Framework/lib/lorawan/lorawan_gateway_single_channel @@ -0,0 +1 @@ +Subproject commit ac1c6516ec9b2998c0c50796a4e5a8b78781dc8c diff --git a/Ubiquitous/XiZi_IIoT/path_kernel.mk b/Ubiquitous/XiZi_IIoT/path_kernel.mk index 6736938db..f5f7345c8 100755 --- a/Ubiquitous/XiZi_IIoT/path_kernel.mk +++ b/Ubiquitous/XiZi_IIoT/path_kernel.mk @@ -533,6 +533,10 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_deviceno KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac/Crypto # KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Phy/region # endif + +ifeq ($(CONFIG_LIB_USING_LORAWAN_GATEWAY_SC),y) +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_gateway_single_channel/inc # +endif endif ifeq ($(CONFIG_CRYPTO), y)