summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-07-04 13:48:05 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2012-07-05 07:04:53 (GMT)
commita12dd0b535aab4fde237cbdceebd37f6d1588364 (patch)
treea6f668363599ac5adb00ba83c902d7e63d6592dc /gsupplicant
parentc1f3036eeabe20903d077f5e0069d644d93d5bfd (diff)
downloadconnman-a12dd0b535aab4fde237cbdceebd37f6d1588364.zip
connman-a12dd0b535aab4fde237cbdceebd37f6d1588364.tar.gz
connman-a12dd0b535aab4fde237cbdceebd37f6d1588364.tar.bz2
gsupplicant: Add a method to set interface's country property
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/gsupplicant.h4
-rw-r--r--gsupplicant/supplicant.c22
2 files changed, 26 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 0f586a1..23ccf19 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -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;
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 5b09a9d..1c03556 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -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;