gsupplicant: Add a method to set interface's country property
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Wed, 4 Jul 2012 13:48:05 +0000 (16:48 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 5 Jul 2012 07:04:53 +0000 (09:04 +0200)
gsupplicant/gsupplicant.h
gsupplicant/supplicant.c

index 0f586a1..23ccf19 100644 (file)
@@ -220,6 +220,10 @@ unsigned int g_supplicant_interface_get_max_scan_ssids(
 
 int g_supplicant_interface_enable_selected_network(GSupplicantInterface *interface,
                                                        dbus_bool_t enable);
+int g_supplicant_interface_set_country(GSupplicantInterface *interface,
+                                       GSupplicantCountryCallback callback,
+                                                       const char *alpha2,
+                                                       void *user_data);
 
 /* Network API */
 struct _GSupplicantNetwork;
index 5b09a9d..1c03556 100644 (file)
@@ -2381,6 +2381,28 @@ int g_supplicant_set_country(const char *alpha2,
                                                regdom);
 }
 
+int g_supplicant_interface_set_country(GSupplicantInterface *interface,
+                                       GSupplicantCountryCallback callback,
+                                                       const char *alpha2,
+                                                       void *user_data)
+{
+       struct supplicant_regdom *regdom;
+
+       regdom = dbus_malloc0(sizeof(*regdom));
+       if (regdom == NULL)
+               return -ENOMEM;
+
+       regdom->callback = callback;
+       regdom->alpha2 = alpha2;
+       regdom->user_data = user_data;
+
+       return supplicant_dbus_property_set(interface->path,
+                               SUPPLICANT_INTERFACE ".Interface",
+                               "Country", DBUS_TYPE_STRING_AS_STRING,
+                               country_params, country_result,
+                                       regdom);
+}
+
 struct interface_data {
        GSupplicantInterface *interface;
        GSupplicantInterfaceCallback callback;