From 6bcb34798246ebbbd6f1b4a1cfd9c9995d3534e1 Mon Sep 17 00:00:00 2001 From: Filipe Cavalcanti Date: Fri, 5 Sep 2025 15:43:42 -0300 Subject: [PATCH] system/ntpc: update ntpc messages Updates verbosity on ntpc commands. Also updated documentation on NuttX side. Signed-off-by: Filipe Cavalcanti --- system/ntpc/Kconfig | 3 ++- system/ntpc/ntpcstart_main.c | 11 +++++++++-- system/ntpc/ntpcstop_main.c | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/system/ntpc/Kconfig b/system/ntpc/Kconfig index a8137ab86..6195cb8e0 100644 --- a/system/ntpc/Kconfig +++ b/system/ntpc/Kconfig @@ -9,7 +9,8 @@ config SYSTEM_NTPC select NETUTILS_NTPCLIENT depends on NET_UDP ---help--- - Enable the NTP client 'start' and 'stop' commands + Enable the NTP client example. This example provides a command-line + interface to manage the NTP client for time synchronization. if SYSTEM_NTPC diff --git a/system/ntpc/ntpcstart_main.c b/system/ntpc/ntpcstart_main.c index dc69a6abe..475ce5f89 100644 --- a/system/ntpc/ntpcstart_main.c +++ b/system/ntpc/ntpcstart_main.c @@ -41,13 +41,20 @@ int main(int argc, FAR char *argv[]) { - int pid = ntpc_start(); + int pid; + + printf("Starting NTP client...\n"); + printf("Using NTP servers: %s\n", CONFIG_NETUTILS_NTPCLIENT_SERVER); + + pid = ntpc_start(); if (pid < 0) { fprintf(stderr, "ERROR: ntpc_start() failed\n"); return EXIT_FAILURE; } - printf("Started the NTP daemon as PID=%d\n", pid); + printf("NTP client started successfully (task ID: %d)\n", pid); + printf("NTP client is now running in the background\n"); + return EXIT_SUCCESS; } diff --git a/system/ntpc/ntpcstop_main.c b/system/ntpc/ntpcstop_main.c index 89cb397e8..2726a61c7 100644 --- a/system/ntpc/ntpcstop_main.c +++ b/system/ntpc/ntpcstop_main.c @@ -41,7 +41,11 @@ int main(int argc, FAR char *argv[]) { - int ret = ntpc_stop(); + int ret = OK; + + printf("Stopping NTP client...\n"); + + ret = ntpc_stop(); if (ret < 0) { fprintf(stderr, "ERROR: ntpc_stop() failed\n");