diff --git a/APP_Framework/Framework/connection/lora/Make.defs b/APP_Framework/Framework/connection/lora/Make.defs index 59f79c833..342ad9396 100644 --- a/APP_Framework/Framework/connection/lora/Make.defs +++ b/APP_Framework/Framework/connection/lora/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # APP_Framework/Framework/connection/lora/Make.defs ############################################################################ -ifneq ($(CONFIG_ADAPTER_SX1278),) +ifneq ($(CONFIG_CONNECTION_ADAPTER_LORA),) CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/connection/lora endif include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/connection/lora/*/Make.defs) diff --git a/APP_Framework/Framework/connection/lora/e220/Make.defs b/APP_Framework/Framework/connection/lora/e220/Make.defs new file mode 100644 index 000000000..f6847eeda --- /dev/null +++ b/APP_Framework/Framework/connection/lora/e220/Make.defs @@ -0,0 +1,6 @@ +############################################################################ +# APP_Framework/Framework/connection/lora/e220/Make.defs +############################################################################ +ifneq ($(CONFIG_ADAPTER_E220),) +CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/connection/lora/e220 +endif diff --git a/APP_Framework/Framework/transform_layer/nuttx/transform.c b/APP_Framework/Framework/transform_layer/nuttx/transform.c index 45d8d30ec..e8d10d294 100644 --- a/APP_Framework/Framework/transform_layer/nuttx/transform.c +++ b/APP_Framework/Framework/transform_layer/nuttx/transform.c @@ -133,40 +133,9 @@ int PrivWrite(int fd, const void *buf, size_t len) return write(fd, buf, len); } -static int PrivSerialIoctl(int fd, int cmd, void *args) +int PrivIoctl(int fd, int cmd, unsigned long args) { - struct SerialDataCfg *serial_cfg = (struct SerialDataCfg *)args; - return ioctl(fd, cmd, serial_cfg); -} - -static int PrivPinIoctl(int fd, int cmd, void *args) -{ - struct PinParam *pin_cfg = (struct PinParam *)args; - - return ioctl(fd, cmd, pin_cfg); -} - -int PrivIoctl(int fd, int cmd, void *args) -{ - int ret = 0; - struct PrivIoctlCfg *ioctl_cfg = (struct PrivIoctlCfg *)args; - - switch (ioctl_cfg->ioctl_driver_type) - { - case SERIAL_TYPE: - ret = PrivSerialIoctl(fd, cmd, ioctl_cfg->args); - break; - case PIN_TYPE: - ret = PrivPinIoctl(fd, cmd, ioctl_cfg->args); - break; - case I2C_TYPE: - ret = ioctl(fd, cmd, ioctl_cfg->args); - break; - default: - break; - } - - return ret; + return ioctl(fd, cmd, args); } /********************memory api************/ diff --git a/APP_Framework/Framework/transform_layer/nuttx/transform.h b/APP_Framework/Framework/transform_layer/nuttx/transform.h index 1cf6b83fc..4ac1ca2fa 100644 --- a/APP_Framework/Framework/transform_layer/nuttx/transform.h +++ b/APP_Framework/Framework/transform_layer/nuttx/transform.h @@ -28,6 +28,7 @@ #include #include #include +#include typedef uint8_t uint8; typedef uint16_t uint16; @@ -43,10 +44,11 @@ typedef int64_t int64; extern "C" { #endif -#define OPE_INT 0x0000 -#define OPE_CFG 0x0001 +#define OPE_INT 0x0000 +#define OPE_CFG 0x0001 + +#define NAME_NUM_MAX 32 -#define NAME_NUM_MAX 32 /*********************GPIO define*********************/ #define GPIO_LOW 0x00 @@ -201,7 +203,7 @@ int PrivOpen(const char *path, int flags); int PrivRead(int fd, void *buf, size_t len); int PrivWrite(int fd, const void *buf, size_t len); int PrivClose(int fd); -int PrivIoctl(int fd, int cmd, void *args); +int PrivIoctl(int fd, int cmd, unsigned long args); /*********************memory***********************/ diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig index 3c98cda38..25a54fb13 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig @@ -659,6 +659,14 @@ config NSH_DISABLE_ADAPTER_4GTEST bool "Disable ec200t Adapter4GTest." default n +config DISABLE_E220_LORATEST + bool "Disable e220 Lora test." + default n + +config DISABLE_E220_LORASEND + bool "Disable e220 Lora send." + default n + config NSH_DISABLE_K210_FFT bool "Disable the K210 fft device." default n diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh.h b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh.h index 11088b6ee..f46851a37 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh.h +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh.h @@ -1492,6 +1492,14 @@ int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); int cmd_Adapter4GTest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); #endif +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORATEST) + int cmd_e220loraTest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +#endif + +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORASEND) + int cmd_e220loraSend(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +#endif + #if defined(CONFIG_K210_FFT_TEST) && !defined(CONFIG_NSH_DISABLE_K210_FFT) int cmd_fft(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); #endif diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_Applicationscmd.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_Applicationscmd.c index e8d465b47..47693892d 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_Applicationscmd.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_Applicationscmd.c @@ -42,7 +42,6 @@ extern void CH438Demo(void); int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { nsh_output(vtbl, "Hello, world!\n"); - FrameworkInit(); CH438Demo(); return OK; } @@ -305,6 +304,28 @@ int cmd_Adapter4GTest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } #endif +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORATEST) +extern void LoraTest(void); +int cmd_e220loraTest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) +{ + nsh_output(vtbl, "Hello, world!\n"); + FrameworkInit(); + LoraTest(); + return OK; +} +#endif + +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORASEND) +extern void LoraSend(int argc, char *argv[]); +int cmd_e220loraSend(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) +{ + nsh_output(vtbl, "Hello, world!\n"); + FrameworkInit(); + LoraSend(argc,argv); + return OK; +} +#endif + #if defined(CONFIG_K210_FFT_TEST) && !defined(CONFIG_NSH_DISABLE_K210_FFT) extern void nuttx_k210_fft_test(void); int cmd_fft(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_command.c b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_command.c index 524c32022..ceecb0f79 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_command.c +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/nsh_command.c @@ -590,7 +590,7 @@ static const struct cmdmap_s g_cmdmap[] = { "xd", cmd_xd, 3, 3, " " }, #endif - { "ch438", cmd_Ch438, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" }, + { "ch438", cmd_Ch438, 1, 1, "[ch438 demo cmd.]" }, #if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS) { "hcho1os", cmd_Hcho1os, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" }, @@ -664,6 +664,14 @@ static const struct cmdmap_s g_cmdmap[] = { "Adapter4GTest", cmd_Adapter4GTest, 1, 1, "[4G ec200t test.]" }, #endif +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORATEST) + { "e220loraTest", cmd_e220loraTest, 1, 1, "[e220 lora test.]" }, +#endif + +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORASEND) + { "e220loraSend", cmd_e220loraSend, 1, 2, "[e220loraSend ]" }, +#endif + #if defined(CONFIG_K210_FFT_TEST) && !defined(CONFIG_NSH_DISABLE_K210_FFT) { "fft", cmd_fft, 1, 1, "[K210 fft function.]" }, #endif