From 30d4201b095ccff3eb8feecfbf5686351970d7ec Mon Sep 17 00:00:00 2001 From: wgzAIIT <820906721@qq.com> Date: Fri, 6 May 2022 12:06:34 +0800 Subject: [PATCH] add loraopen to cmd --- .../app_match_nuttx/apps/nshlib/Kconfig | 8 ++++++-- .../app_match_nuttx/apps/nshlib/nsh.h | 4 ++++ .../app_match_nuttx/apps/nshlib/nsh_Applicationscmd.c | 11 +++++++++++ .../app_match_nuttx/apps/nshlib/nsh_command.c | 4 ++++ 4 files changed, 25 insertions(+), 2 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 96c5fb6c5..4e03b59d8 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/apps/nshlib/Kconfig @@ -664,14 +664,18 @@ config NSH_DISABLE_ADAPTER_4GTEST bool "Disable ec200t Adapter4GTest." default n -config DISABLE_E220_LORATEST +config NSH_DISABLE_E220_LORATEST bool "Disable e220 Lora test." default n -config DISABLE_E220_LORASEND +config NSH_DISABLE_E220_LORASEND 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 912397b01..6a950f277 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 @@ -1502,6 +1502,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb, 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); +#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 465f21be4..b1d0c3769 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 @@ -327,6 +327,17 @@ 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) +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(); + 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 efe59c107..d4d5e01e2 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 @@ -674,6 +674,10 @@ static const struct cmdmap_s g_cmdmap[] = { "e220loraSend", 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.]" }, #endif