File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff 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
1415if SYSTEM_NTPC
1516
Original file line number Diff line number Diff line change 4141
4242int 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}
Original file line number Diff line number Diff line change 4141
4242int 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" );
You can’t perform that action at this time.
0 commit comments