Skip to content

Commit 6bcb347

Browse files
fdcavalcanticederom
authored andcommitted
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>
1 parent ac08faa commit 6bcb347

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

system/ntpc/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ config SYSTEM_NTPC
99
select NETUTILS_NTPCLIENT
1010
depends on NET_UDP
1111
---help---
12-
Enable the NTP client 'start' and 'stop' commands
12+
Enable the NTP client example. This example provides a command-line
13+
interface to manage the NTP client for time synchronization.
1314

1415
if SYSTEM_NTPC
1516

system/ntpc/ntpcstart_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@
4141

4242
int main(int argc, FAR char *argv[])
4343
{
44-
int pid = ntpc_start();
44+
int pid;
45+
46+
printf("Starting NTP client...\n");
47+
printf("Using NTP servers: %s\n", CONFIG_NETUTILS_NTPCLIENT_SERVER);
48+
49+
pid = ntpc_start();
4550
if (pid < 0)
4651
{
4752
fprintf(stderr, "ERROR: ntpc_start() failed\n");
4853
return EXIT_FAILURE;
4954
}
5055

51-
printf("Started the NTP daemon as PID=%d\n", pid);
56+
printf("NTP client started successfully (task ID: %d)\n", pid);
57+
printf("NTP client is now running in the background\n");
58+
5259
return EXIT_SUCCESS;
5360
}

system/ntpc/ntpcstop_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141

4242
int main(int argc, FAR char *argv[])
4343
{
44-
int ret = ntpc_stop();
44+
int ret = OK;
45+
46+
printf("Stopping NTP client...\n");
47+
48+
ret = ntpc_stop();
4549
if (ret < 0)
4650
{
4751
fprintf(stderr, "ERROR: ntpc_stop() failed\n");

0 commit comments

Comments
 (0)