You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/03/18 15:44:00 UTC
(nuttx-apps) 02/02: examples/nxscope: add UDP interface
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 7884410be2d18957d7ee951f42cfd8d62d79d44d
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Mar 16 13:56:01 2026 +0100
examples/nxscope: add UDP interface
add UDP interface for examples/nxscope
Signed-off-by: raiden00pl <ra...@railab.me>
---
examples/nxscope/Kconfig | 9 +++++++++
examples/nxscope/nxscope_main.c | 22 ++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/examples/nxscope/Kconfig b/examples/nxscope/Kconfig
index b29f97f26..49d36f270 100644
--- a/examples/nxscope/Kconfig
+++ b/examples/nxscope/Kconfig
@@ -43,6 +43,15 @@ config EXAMPLES_NXSCOPE_CDCACM
endif # LOGGING_NXSCOPE_INTF_SERIAL
+if LOGGING_NXSCOPE_INTF_UDP
+
+config EXAMPLES_NXSCOPE_UDP_PORT
+ int "nxscope UDP local port"
+ default 50000
+ range 1 65535
+
+endif # LOGGING_NXSCOPE_INTF_UDP
+
config EXAMPLES_NXSCOPE_FORCE_ENABLE
bool "nxscope force enable"
default n
diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c
index b2311a74a..5d5102e99 100644
--- a/examples/nxscope/nxscope_main.c
+++ b/examples/nxscope/nxscope_main.c
@@ -431,6 +431,9 @@ int main(int argc, FAR char *argv[])
#ifdef CONFIG_LOGGING_NXSCOPE_INTF_SERIAL
struct nxscope_ser_cfg_s nxs_ser_cfg;
#endif
+#ifdef CONFIG_LOGGING_NXSCOPE_INTF_UDP
+ struct nxscope_udp_cfg_s nxs_udp_cfg;
+#endif
#ifdef CONFIG_LOGGING_NXSCOPE_INTF_DUMMY
struct nxscope_dummy_cfg_s nxs_dummy_cfg;
#endif
@@ -484,6 +487,22 @@ int main(int argc, FAR char *argv[])
}
#endif
+#ifdef CONFIG_LOGGING_NXSCOPE_INTF_UDP
+ /* Configuration */
+
+ nxs_udp_cfg.port = CONFIG_EXAMPLES_NXSCOPE_UDP_PORT;
+ nxs_udp_cfg.nonblock = true;
+
+ /* Initialize UDP interface */
+
+ ret = nxscope_udp_init(&intf, &nxs_udp_cfg);
+ if (ret < 0)
+ {
+ printf("ERROR: nxscope_udp_init failed %d\n", ret);
+ goto errout_nointf;
+ }
+#endif
+
#ifdef CONFIG_LOGGING_NXSCOPE_INTF_DUMMY
/* Configuration */
@@ -733,6 +752,9 @@ errout_nonxscope:
#if defined(CONFIG_LOGGING_NXSCOPE_INTF_SERIAL)
nxscope_ser_deinit(&intf);
#endif
+#if defined(CONFIG_LOGGING_NXSCOPE_INTF_UDP)
+ nxscope_udp_deinit(&intf);
+#endif
#if defined(CONFIG_LOGGING_NXSCOPE_INTF_DUMMY)
nxscope_dummy_deinit(&intf);
#endif