On Wed, 2010-08-25 at 15:11 +0300, Jussi Kukkonen wrote:
> On 08/25/2010 02:06 PM, Stefan Kost wrote:
>  > yes, I am on a wired connection...
> 
> Hmmm, it's unfortunate that the wired router MAC isn't available via 
> this connman implementation. It would be just as useful.
> 
>  >.. and indeed if I enable wireless I get those warnings instead:
>  > ** (geoclue-test-gui:27072): WARNING **: Error getting position: Could
>  > not understand reply from server
>  > ** (geoclue-test-gui:27072): WARNING **: Error getting address: Could
>  > not understand reply from server
> 
> The warning comes from a web provider that cannot parse the response 
> from the service. I see that at least Plazes does that now, they seem to 
> expect a lower case mac address... not sure if this is a new phenomenon.

Does something like the attached work for you, Stefan?

Cheers
>From cb60a318e901eb0c57ea38c6dd0f3af53e5a8268 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Wed, 25 Aug 2010 13:42:57 +0100
Subject: [PATCH] plazes: Use lower-case MAC address

As the service does not recognise upper-case ones.
---
 providers/plazes/geoclue-plazes.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/providers/plazes/geoclue-plazes.c b/providers/plazes/geoclue-plazes.c
index 1f3ecd3..b0843ff 100644
--- a/providers/plazes/geoclue-plazes.c
+++ b/providers/plazes/geoclue-plazes.c
@@ -102,6 +102,16 @@ geoclue_plazes_set_status (GeocluePlazes *self, GeoclueStatus status)
     }
 }
 
+static char *
+mac_strdown (char *mac)
+{
+	guint i;
+	for (i = 0; mac[i] != '\0' ; i++) {
+		if (g_ascii_isalpha (mac[i]))
+			mac[i] = g_ascii_tolower (mac[i]);
+	}
+	return mac;
+}
 /* Position interface implementation */
 
 static gboolean 
@@ -135,22 +145,23 @@ geoclue_plazes_get_position (GcIfacePosition        *iface,
 		geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_ERROR);
 		return FALSE;
 	}
-	
-    geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_ACQUIRING);
+	mac = mac_strdown (mac);
+
+	geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_ACQUIRING);
 
 	if (!gc_web_service_query (plazes->web_service, error,
-	                           PLAZES_KEY_MAC, mac, 
+	                           PLAZES_KEY_MAC, mac,
 	                           (char *)0)) {
 		g_free (mac);
         // did not get a reply; we can try again later
 		geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_AVAILABLE);
-		g_set_error (error, GEOCLUE_ERROR, 
-		             GEOCLUE_ERROR_NOT_AVAILABLE, 
+		g_set_error (error, GEOCLUE_ERROR,
+		             GEOCLUE_ERROR_NOT_AVAILABLE,
 		             "Did not get reply from server");
 		return FALSE;
 	}
 	g_free (mac);
-	
+
 	if (latitude && gc_web_service_get_double (plazes->web_service, 
 	                                           latitude, PLAZES_LAT_XPATH)) {
 		*fields |= GEOCLUE_POSITION_FIELDS_LATITUDE;
-- 
1.7.0.1

_______________________________________________
GeoClue mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/geoclue

Reply via email to