diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-07-04 16:48:05 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-07-05 09:04:53 +0200 |
commit | a12dd0b535aab4fde237cbdceebd37f6d1588364 (patch) | |
tree | a6f668363599ac5adb00ba83c902d7e63d6592dc /gsupplicant | |
parent | c1f3036eeabe20903d077f5e0069d644d93d5bfd (diff) | |
download | connman-a12dd0b535aab4fde237cbdceebd37f6d1588364.tar.gz connman-a12dd0b535aab4fde237cbdceebd37f6d1588364.tar.bz2 connman-a12dd0b535aab4fde237cbdceebd37f6d1588364.zip |
gsupplicant: Add a method to set interface's country property
Diffstat (limited to 'gsupplicant')
-rw-r--r-- | gsupplicant/gsupplicant.h | 4 | ||||
-rw-r--r-- | gsupplicant/supplicant.c | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h index 0f586a11..23ccf199 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 5b09a9dc..1c03556e 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; |