mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00: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:
parent
ac08faa2b8
commit
6bcb347982
3 changed files with 16 additions and 4 deletions
|
|
@ -9,7 +9,8 @@ config SYSTEM_NTPC
|
||||||
select NETUTILS_NTPCLIENT
|
select NETUTILS_NTPCLIENT
|
||||||
depends on NET_UDP
|
depends on NET_UDP
|
||||||
---help---
|
---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
|
if SYSTEM_NTPC
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,20 @@
|
||||||
|
|
||||||
int main(int argc, FAR char *argv[])
|
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)
|
if (pid < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: ntpc_start() failed\n");
|
fprintf(stderr, "ERROR: ntpc_start() failed\n");
|
||||||
return EXIT_FAILURE;
|
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;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,11 @@
|
||||||
|
|
||||||
int main(int argc, FAR char *argv[])
|
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)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: ntpc_stop() failed\n");
|
fprintf(stderr, "ERROR: ntpc_stop() failed\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue