mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 15:32:21 +08:00
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:

committed by
CeDeROM

parent
ac08faa2b8
commit
6bcb347982
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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");
|
||||
|
Reference in New Issue
Block a user