From: Tomasz Bursztyka Date: Wed, 4 Jul 2012 13:48:05 +0000 (+0300) Subject: gsupplicant: Add a method to set interface's country property X-Git-Tag: 1.4~64 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fconnman.git;a=commitdiff_plain;h=a12dd0b535aab4fde237cbdceebd37f6d1588364 gsupplicant: Add a method to set interface's country property --- 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;