Provider selection algorithm

Javier Fernandez Garcia-Boente jfernandez at igalia.com
Tue Jun 15 00:54:43 PDT 2010


I've been playing a bit with the Master provider and i noticed that the
providers selection algorithm is still unimplemented. Currently, if i've
understood the code, the first available provider is always selected:

/* TODO: currently returning even providers that are worse than
priv->min_accuracy, if nothing else is available */ 
if (gc_master_provider_get_status (provider) ==GEOCLUE_STATUS_AVAILABLE)
{ 
        /* unsubscribe from all providers worse than this */
	gc_master_client_unsubscribe_providers (client,l->next,iface);  
        return provider;
}

I think this shouldn't be a problem, but if im not wrong, it always
selects the manual provider, which is always available. I guess it would
depend on the order of the providers list reading operation, but i've
experimented that most of times the manual provider is selected, even if
the Localnet, for instance, is also available.

I've implemented a patch, not very tested yet, trying to face this
problem. I would like to get some feedback about this issue, since i
guess is a well known problem and perhaps you already had some
alternative approaches.

Greetings, 


-- 
Javi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 4721 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/geoclue/attachments/20100615/1cde64ce/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/geoclue/attachments/20100615/1cde64ce/attachment.pgp>


More information about the GeoClue mailing list