Hi all,

if you want to build a lora node firmware

  pkg.deps:
    - "@apache-mynewt-core/net/lora/node"

without LORA_NODE_CLI support

  syscfg.vals:
        LORA_NODE_CLI: 0
        LORA_NODE_LOG_CLI: 0

and (thus) without shell and parse dependency added to your project, you will get an error like:

Compiling repos/apache-mynewt-core/net/lora/node/src/lora_cli.c
Error: repos/apache-mynewt-core/net/lora/node/src/lora_cli.c:23:10: fatal error: shell/shell.h: No such file or directory
 #include "shell/shell.h"
          ^~~~~~~~~~~~~~~
compilation terminated.

The attached patch fixes this issue by checking for LORA_NODE_CLI support earlier.

Hope I didn't get anything wrong.

Best,
Frank
diff --git a/net/lora/node/src/lora_cli.c b/net/lora/node/src/lora_cli.c
index 27d6fcb48..e1291ecae 100644
--- a/net/lora/node/src/lora_cli.c
+++ b/net/lora/node/src/lora_cli.c
@@ -18,6 +18,9 @@
  */
 
 #include "os/mynewt.h"
+
+#if MYNEWT_VAL(LORA_NODE_CLI)
+
 #include <inttypes.h>
 #include <string.h>
 #include "shell/shell.h"
@@ -25,8 +28,6 @@
 #include "parse/parse.h"
 #include "node/lora_priv.h"
 
-#if MYNEWT_VAL(LORA_NODE_CLI)
-
 static int lora_cli_cmd_fn(int argc, char **argv);
 static int lora_cli_set_freq(int argc, char **argv);
 static int lora_cli_tx_cfg(int argc, char **argv);

Reply via email to