return 1;
}
+int test_set_ntp_server(void)
+{
+ int rv = 0;
+ char input_str1[100] = {0,};
+
+ if (test_get_user_string("Enter NTP Server Url (Enter for skip) :", input_str1, 100)) {
+
+ g_strstrip(input_str1);
+
+ rv = connection_set_ntp_server(connection, input_str1);
+
+ if (rv != CONNECTION_ERROR_NONE) {
+ printf("Fail to set NTP Server [%s]\n", test_print_error(rv));
+ return -1;
+ }
+
+ printf("Retval = [%s]\n",test_print_error(rv));
+ }
+
+ return 1;
+}
+
+int test_get_ntp_server(void)
+{
+ int rv = 0;
+ char *ntp_server;
+
+ rv = connection_get_ntp_server(connection, &ntp_server);
+
+ if (rv != CONNECTION_ERROR_NONE) {
+ printf("Fail to get ntp server [%s]\n", test_print_error(rv));
+ return -1;
+ }
+
+ printf("Retval = [%s] NTP Server : [%s]\n", test_print_error(rv), ntp_server);
+
+ free(ntp_server);
+
+ return 1;
+}
+
+int test_clear_ntp_server(void)
+{
+ int rv = 0;
+
+ rv = connection_clear_ntp_server(connection);
+
+ if (rv != CONNECTION_ERROR_NONE) {
+ printf("Fail to clear ntp server[%s]\n", test_print_error(rv));
+ return -1;
+ }
+
+ printf("Retval = [%s]\n", test_print_error(rv));
+
+ return 1;
+}
+
int main(int argc, char **argv)
{
GMainLoop *mainloop;
printf("S - Connect Ethernet EAP)\n");
printf("T - Get EAPoL info)\n");
printf("U - Get Clock update info)\n");
+ printf("V - Set NTP Server\n");
+ printf("W - Get NTP Server\n");
+ printf("X - Clear NTP Server\n");
printf(LOG_RED "0 - Exit \n" LOG_END);
printf("ENTER - Show options menu.......\n");
}
case 'U':
rv = test_get_clock_update_info();
break;
+ case 'V':
+ rv = test_set_ntp_server();
+ break;
+ case 'W':
+ rv = test_get_ntp_server();
+ break;
+ case 'X':
+ rv = test_clear_ntp_server();
+ break;
}
if (rv == 1)