implement org.freedesktop.Geoclue.Position iface for localnet ?

arno arno at renevier.net
Fri Feb 26 09:31:52 PST 2010


Hi,
I've made some progress regarding implementation of position interface in 
localnet.

I still think it's really important for users to be able to set a "fake" 
position (see for example, the recent pleaserobme.com buzz), and 
unfortunately, web browsers will probably just use master provider. So I've 
implemented SetPositionDefault et SetAddressDefault. 

If that's not ok, I can implement that functionality as a "fakelocation" 
provider, but that will be less easy for user (he'll known he'll have to 
choose between two providers), and also less powerfull. Example of use case 
covered by the localnet-with-default solution: user may wish to provide it's 
real location when he's at work, but may wish to tell he's at home in any 
other case.

Apart from that, here are some comments about my patch.

As seen with Jussi on irc, I removed SetAddressFields method because it was 
redundant with simple SetAddress

get_address (and get_position) return false if no address (or position) is 
found.

To delete address informations, callers needs to call SetAdress with an empty 
hashtable to delete position informations, and call setPosition with invalid 
latitude and longitude (for example -200°), a 0.0 horizontal and vertical 
accuracy, and a altitude lesser than -20000meters (I didn't find a better way 
to represent an invalid altitude).

I've written two example programs: localnet-position-example and 
localnet-address-example. They read current position (or address) and set new 
ones. Before returning, they set back initial values, to not messe user data 
with example program.

This patch is a major rewrote of geoclue-localnet, so there may be incorrect 
modifications, modifications I shouldn't have done, or modifications I should 
have done. I'd be happy to have feedback to known how I can improve it.

http://bugs.freedesktop.org/show_bug.cgi?id=26777

regards
arno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/geoclue/attachments/20100226/5c4c90ae/attachment.pgp>


More information about the GeoClue mailing list