From: Manika Shrivastava Date: Tue, 20 Jun 2023 08:58:06 +0000 (+0530) Subject: Add dbus method to UnsetNtpServer. X-Git-Tag: accepted/tizen/unified/20230628.023645~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac204050d3994f4b3e04b61b1d31b8b3473e4fed;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Add dbus method to UnsetNtpServer. Change-Id: I8a130c85069205cb8185df1684ef1794d2508de6 Signed-off-by: Manika Shrivastava --- diff --git a/interfaces/netconfig-iface-clock.xml b/interfaces/netconfig-iface-clock.xml index 0f78bed..ed3b034 100644 --- a/interfaces/netconfig-iface-clock.xml +++ b/interfaces/netconfig-iface-clock.xml @@ -4,5 +4,7 @@ + + diff --git a/resources/etc/dbus-1/system.d/net-config-robot.conf b/resources/etc/dbus-1/system.d/net-config-robot.conf index 81cba6c..ce8e986 100755 --- a/resources/etc/dbus-1/system.d/net-config-robot.conf +++ b/resources/etc/dbus-1/system.d/net-config-robot.conf @@ -121,5 +121,6 @@ + diff --git a/resources/etc/dbus-1/system.d/net-config.conf b/resources/etc/dbus-1/system.d/net-config.conf index cbbf252..f815a38 100755 --- a/resources/etc/dbus-1/system.d/net-config.conf +++ b/resources/etc/dbus-1/system.d/net-config.conf @@ -123,5 +123,6 @@ + diff --git a/src/network-clock.c b/src/network-clock.c index 127f8e7..d40b506 100755 --- a/src/network-clock.c +++ b/src/network-clock.c @@ -235,6 +235,17 @@ gboolean handle_set_ntp_server(Clock *object, GDBusMethodInvocation *invocation, return TRUE; } +gboolean handle_unset_ntp_server(Clock *object, GDBusMethodInvocation *invocation) +{ + __netconfig_clock_unset_timeserver(); + + DBG("NTP Server unset successfully"); + + clock_complete_unset_ntp_server(object, invocation); + + return TRUE; +} + /***************************** * Initializations Functions * ****************************/ @@ -258,6 +269,10 @@ void clock_object_create_and_init(void) g_signal_connect(clock_object, "handle-set-ntp-server", G_CALLBACK(handle_set_ntp_server), NULL); + /* Unset NTP Server */ + g_signal_connect(clock_object, "handle-unset-ntp-server", + G_CALLBACK(handle_unset_ntp_server), NULL); + if (!g_dbus_interface_skeleton_export(interface_clock, connection, NETCONFIG_CLOCK_PATH, NULL)) { ERR("Export NETCONFIG_CLOCK_PATH for clock failed");