From f106ac7c4375ed32f64e89df0d9aaae0996c0f76 Mon Sep 17 00:00:00 2001 From: wgzAIIT <820906721@qq.com> Date: Tue, 10 May 2022 17:54:07 +0800 Subject: [PATCH] add loraopen to cmd --- .../app_match_nuttx/apps/nshlib/Kconfig | 10 +++---- .../app_match_nuttx/apps/nshlib/nsh.h | 12 +++------ .../apps/nshlib/nsh_Applicationscmd.c | 27 ++++++------------- .../app_match_nuttx/apps/nshlib/nsh_command.c | 11 +++----- 4 files changed, 19 insertions(+), 41 deletions(-) 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 4e03b59d8..215fedfe3 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig @@ -664,18 +664,14 @@ config NSH_DISABLE_ADAPTER_4GTEST bool "Disable ec200t Adapter4GTest." default n -config NSH_DISABLE_E220_LORATEST - bool "Disable e220 Lora test." +config NSH_DISABLE_E220_LORA_RECEIVE + bool "Disable e220 Lora receive." default n -config NSH_DISABLE_E220_LORASEND +config NSH_DISABLE_E220_LORA_SEND bool "Disable e220 Lora send." default n -config NSH_DISABLE_E220_LORAOPEN - bool "Disable e220 Lora open." - 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 6a950f277..9574506eb 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 @@ -1494,16 +1494,12 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb, 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); +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_RECEIVE) + int cmd_E220LoraReceive(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_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORAOPEN) - int cmd_e220LoraOpen(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_SEND) + 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) 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 b1d0c3769..9357d46ae 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 @@ -305,35 +305,24 @@ 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) +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_RECEIVE) +void E220LoraReceive(void); +int cmd_E220LoraReceive(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { nsh_output(vtbl, "Hello, world!\n"); FrameworkInit(); - LoraTest(); + E220LoraReceive(); 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) +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_SEND) +extern void E220LoraSend(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_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORAOPEN) -extern void LoraOpen(void); -int cmd_e220LoraOpen(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) -{ - nsh_output(vtbl, "Hello, world!\n"); - FrameworkInit(); - LoraOpen(); + E220LoraSend(argc,argv); return OK; } #endif 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 d4d5e01e2..042c44105 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 @@ -666,17 +666,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.]" }, +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_RECEIVE) + { "E220Receive", cmd_E220LoraReceive, 1, 1, "[e220 lora receive.]" }, #endif -#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORASEND) - { "e220loraSend", cmd_e220loraSend, 1, 2, "[e220loraSend ]" }, +#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_SEND) + { "e220Send", cmd_E220LoraSend, 1, 2, "[e220loraSend ]" }, #endif -#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORAOPEN) - { "e220loraOpen", cmd_e220LoraOpen, 1, 1, "[e220lora open device" }, -#endif #if defined(CONFIG_K210_FFT_TEST) && !defined(CONFIG_NSH_DISABLE_K210_FFT) { "fft", cmd_fft, 1, 1, "[K210 fft function.]" },