Merge "Remove the unused code." into tizen
[platform/core/connectivity/net-config.git] / src / wifi-passpoint.c
index 340019d..8509b9f 100755 (executable)
 #include "wifi-passpoint.h"
 
 #if defined TIZEN_WLAN_PASSPOINT
-static gboolean netconfig_wifi_get_passpoint(gint32 *enabled)
+static gboolean netconfig_wifi_get_passpoint(const char *interface_name, gint32 *enabled)
 {
        GVariant *reply, *var = NULL;
        gboolean value;
        gboolean result = FALSE;
 
-       reply = netconfig_supplicant_invoke_dbus_interface_property_get(SUPPLICANT_IFACE_INTERFACE,
-                               "Passpoint");
+       reply = netconfig_supplicant_invoke_dbus_interface_property_get(interface_name, "Passpoint");
        if (reply == NULL) {
                ERR("Error!!! Failed to get passpoint property");
                return FALSE;
@@ -60,14 +59,13 @@ static gboolean netconfig_wifi_get_passpoint(gint32 *enabled)
        return result;
 }
 
-static gboolean netconfig_wifi_set_passpoint(gint32 enable)
+static gboolean netconfig_wifi_set_passpoint(const char *interface_name, gint32 enable)
 {
        gint32 value = enable ? 1 : 0;
        gboolean result = FALSE;
 
-       result = netconfig_supplicant_invoke_dbus_interface_property_set(
-                       SUPPLICANT_IFACE_INTERFACE, "Passpoint",
-                       g_variant_new_int32(value), NULL);
+       result = netconfig_supplicant_invoke_dbus_interface_property_set(interface_name,
+                       "Passpoint", g_variant_new_int32(value), NULL);
        if (result == FALSE)
                ERR("Fail to set passpoint enable[%d]", enable);
 
@@ -75,13 +73,14 @@ static gboolean netconfig_wifi_set_passpoint(gint32 enable)
 }
 #endif
 
-gboolean handle_get_passpoint(Wifi *wifi, GDBusMethodInvocation *context)
+gboolean handle_get_passpoint(Wifi *wifi, GDBusMethodInvocation *context,
+               const char *ifname)
 {
        gint32 enable = 0;
        g_return_val_if_fail(wifi != NULL, TRUE);
 
 #if defined TIZEN_WLAN_PASSPOINT
-       netconfig_wifi_get_passpoint(&enable);;
+       netconfig_wifi_get_passpoint(ifname, &enable);;
 #else
        enable = 0;
 #endif
@@ -89,12 +88,13 @@ gboolean handle_get_passpoint(Wifi *wifi, GDBusMethodInvocation *context)
        return TRUE;
 }
 
-gboolean handle_set_passpoint(Wifi *wifi, GDBusMethodInvocation *context, gint enable)
+gboolean handle_set_passpoint(Wifi *wifi, GDBusMethodInvocation *context,
+               const char *ifname, gint enable)
 {
        g_return_val_if_fail(wifi != NULL, TRUE);
 
 #if defined TIZEN_WLAN_PASSPOINT
-       netconfig_wifi_set_passpoint(enable);
+       netconfig_wifi_set_passpoint(ifname, enable);
 #endif
        wifi_complete_set_passpoint(wifi, context);
        return TRUE;