system/ntpc: update ntpc messages

Updates verbosity on ntpc commands. Also updated documentation on NuttX side.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
This commit is contained in:
Filipe Cavalcanti
2025-09-05 15:43:42 -03:00
committed by CeDeROM
parent ac08faa2b8
commit 6bcb347982
3 changed files with 16 additions and 4 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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");