[PATCH 1/4] gsupplicant: add interface parameter to set the country

jmassot at aldebaran-robotics.com jmassot at aldebaran-robotics.com
Fri Feb 10 01:47:05 PST 2012


From: Julien Massot <jmassot at aldebaran-robotics.com>

---
 gsupplicant/gsupplicant.h |    8 ++++----
 gsupplicant/supplicant.c  |    8 +++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 8e96e02..05db131 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -149,10 +149,6 @@ typedef struct _GSupplicantScanParams GSupplicantScanParams;
 /* global API */
 typedef void (*GSupplicantCountryCallback) (void *user_data);
 
-int g_supplicant_set_country(const char *alpha2,
-				GSupplicantCountryCallback callback,
-						const void *user_data);
-
 /* Interface API */
 struct _GSupplicantInterface;
 
@@ -185,6 +181,10 @@ int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
 
 int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
 							unsigned int ap_scan);
+int g_supplicant_interface_set_country(GSupplicantInterface *interface,
+					const char *alpha2,
+					GSupplicantCountryCallback callback,
+						const void *user_data);
 
 void g_supplicant_interface_set_data(GSupplicantInterface *interface,
 								void *data);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 3e61f74..bab45e2 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2184,8 +2184,9 @@ static void country_params(DBusMessageIter *iter, void *user_data)
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &country);
 }
 
-int g_supplicant_set_country(const char *alpha2,
-				GSupplicantCountryCallback callback,
+int g_supplicant_interface_set_country(GSupplicantInterface *interface,
+					const char *alpha2,
+					GSupplicantCountryCallback callback,
 					const void *user_data)
 {
 	struct supplicant_regdom *regdom;
@@ -2202,7 +2203,8 @@ int g_supplicant_set_country(const char *alpha2,
 	regdom->callback = callback;
 	regdom->user_data = user_data;
 
-	return supplicant_dbus_property_set(SUPPLICANT_PATH, SUPPLICANT_INTERFACE,
+	return supplicant_dbus_property_set(interface->path,
+					SUPPLICANT_INTERFACE ".Interface",
 					"Country", DBUS_TYPE_STRING_AS_STRING,
 					country_params, country_result,
 						regdom);
-- 
1.7.5.4




More information about the connman mailing list