Just for your information, but Jussi and I had quite a long conversation detailing some of the internal of how geoclue is progressing.&nbsp;&nbsp; If you are interested read on.&nbsp;&nbsp; <br><br><br>jku: Hey, what are your plans in the next week or two regarding geoclue? Writing the geoclue control UI (a statusbar applet, or panel applet in gnome terms) for maemo revealed several problems I could start solving -- but I don&#39;t want to get in the way if you&#39;re in the middle of something....
<br>Sent at 10:11 AM on Wednesday<br>me: No, I&#39;m not in the middle of anything right now.<br>What problems are you seeing with the applet?<br>jku: I probably won&#39;t remember everything (haven&#39;t collected my notes yet), but:
<br>1. the &quot;default provider&quot; idea doesn&#39;t work like I expected:<br>Sent at 10:15 AM on Wednesday<br>jku: If I subscribe to a signal from the default provider I&#39;d expect the provider to change when the gconf key changes (so new provider signals are now received)
<br>Matter of opinion I guess, but that&#39;s what my use cases would want<br>2. get_all_position_providers isn&#39;t working<br>Sent at 10:17 AM on Wednesday<br>jku: 3. I&#39;m having problems with getting a valid userdata-pointer from the signals (this could be a bug in my code though)
<br>Sent at 10:19 AM on Wednesday<br>jku: 4. civic location signals do not have timestamps (I guess they should, at least for consistency)<br>Sent at 10:20 AM on Wednesday<br>jku: 5. (this is probably my fault) one of the civic location callbacks / methods has a bit different signature from the rest -- it works but is unexpected
<br>Sent at 10:23 AM on Wednesday<br>jku: That&#39;s about it, I guess<br>Sent at 10:24 AM on Wednesday<br>me: hmm.. yeah there is a little work<br>jku: What&#39;s your take on #1<br>me: for the get_all_providers, we need to move the code from the old geoclue master to the C client library
<br>for the default provider, we need to implement geoclue master, it&#39;s nowhere to be seen.<br>All it really needs to do, is implement the position api and forward out calls (could even use the client library itself) to a backend based on a gconf key, or what ones are available
<br>jku: yes, agreed<br>me: I know the signal problem.<br>Let me commit some code, one sec<br>Sorry, I forgot to commit it when I was correcting a few things.<br>Since now we dont catch the callback in the library and then pass them on, the parameters are different.
<br>gobject signals what to add the gobject pointer to the front of them.<br>so it is signal(gobject, parameters..., userdata)<br>jku: ok, good<br>me: I remade the callback typedef to have a void* unused at the beginning, that fills in for the the gobject pointer.
<br>it&#39;s useless to clients, but always gets marshalled in.<br>Sent at 10:32 AM on Wednesday<br>jku: I&#39;ll take a look. About get_all_providers: do you mean that the C wrapper should scan /usr/local/share/geoclue/backend like master does now?
<br>Or what was the idea?<br>me: Yeah, that&#39;s the idea<br>I think that is easiest.<br>Sent at 10:34 AM on Wednesday<br>me: I think I&#39;ve been getting an idea on the signals for position.&nbsp;&nbsp; I liked your idea of filtering.
<br>It would be hard to give a few paramters to the position signal and then internally filter them.<br>jku: would or would not?<br>me: That way the backend can signal all they want (like a gps that keep broadcasting the same position, but with new timestamps.)
<br>would not<br>we could have a timestamp filter, and a position filter.&nbsp;&nbsp; I&#39;ll probably add that next time I start hacking.<br>jku: sounds good<br>Sent at 10:37 AM on Wednesday<br>jku: about timestamp: what do you think it should be for webservice backends? I&#39;m thinking it&#39;s just current time (even if the query may have been done hours ago when the current internet connection was made) since it&#39;s going to be correct 99% of the time
<br>There should maybe be a a timer the requeries after some hours, but basically I think we can trust hostip and plazes location fo as long as the connection is up<br>s/timer the/timer that/<br>Sent at 10:40 AM on Wednesday
<br>jku: so what was wrong with the previous implementation of get_all_providers? It C wrapper asked geoclue_master IIRC..<br>me: Webservice timestamp should be the time that it contacted the webservice (usually now)<br>jku: on maemo I have libconic that tells me when connections start and stop, so I only query when a connection is made
<br>me: yeah, then that timestamp is when the connection started and the service was quieried<br>jku: agreed<br>me: I don&#39;t like that you contact a dbus service that just reads files directly.<br>jku: ?<br>me: I don&#39;t think geoclue master should have any specific API at this point, it should just be a proxy for filter between multiple backends.
<br>so that like was about geoclue-master<br>my typing is horrible today<br>jku: [smile]<br>me: (sorry that line was about geoclue master)<br>Sent at 10:49 AM on Wednesday<br>me: DBUS is a nice abstract thing, but I am realizing it can be slow, so if you can do something easily yourself, then you can avoid DBUS , (
i.e. the get_all_providers)<br>jku: IPC tends to be slow, yes<br>me: oh yeah, just a note, but if you take a crack at geoclue master, there is a slight trick.&nbsp;&nbsp; to do a sychronous DBUS call inside a synchrounous DBUS call you need some thread tricker and private DBUS connections.
<br>jku: but I can&#39;t imagine get_all_providers or get_default_provider is done so often that it&#39;s a problem?<br>me: trickery<br>Yeah, it&#39;s not a speed issue, it is more that I don&#39;t like what geoclue master is currently doing and I&#39;ve reenvisioned it as a proxy.
<br>Previously, I saw it as somehting you connected to to find out who to directly connect to.<br>Now I see it was someone who mimics teh api of the other backends and proxies to them based on .....magic.....<br>jku: yes, exactly
<br>magic is the word I was looking for...<br>me: Does that make sense?<br>magic... really just means an algorithm To Be Determined.<br>jku: Oh it makes sense. Absolutely. The problem is that then geoclue really needs bindings...
<br>even on languages that have easy dbus access<br>Because otherwise you need to know about gconf keys and files in /usr/local/share/geoclue/backend...&#39;<br>me: we typically, unless you want to check for a specific provider and use it directly you shouldn&#39;t need _get_all_position_providers.
<br>That is really for advanced people that want to do weird things.<br>jku: yes, you&#39;re right<br>me: I figure the only apps that will ever use that might be our example apps.<br>Like we have an app that connects to every availble backend and displays it&#39;s current status.
<br>Otherwise, you should just connect to geoclue master and be done with it.<br>It it is necessary, we can add it back later, but I don&#39;t think it will be.<br>jku: ok, true. My configuration UI is a special case.<br>
Sent at 10:58 AM on Wednesday<br>me: Yeah probably, the configuration should become automatic(ok, mostly automatic) with geoclue master<br>Maybe for now the gconf default key can just be the Hint to geoclue-master which to check first.
<br>Sent at 11:00 AM on Wednesday<br>jku: ultimately there needs to be a preference list. I have a feeling that getting geoclue-master magic working nicely is going to be a lot of work...<br>Sent at 11:03 AM on Wednesday<br>
me: Yeah, maybe configuration can just be a preference list,&nbsp;&nbsp; I kind of like that idea..<br>use&nbsp; GPS, hostip and then manual.....<br>Sent at 11:06 AM on Wednesday<br>jku: I&#39;ll have to go. I&#39;ll probably move the&nbsp; get_all_providers code to the wrapper soon, so I can dynamically create the provider menu in my UI.
<br>me: ok, it might be good to post this conversation to the list<br>Are you ok if I do this?<br>jku: and add timestamps to civic location signals/methods<br>Go ahead. While you&#39;re at it, answer the guy who asked about get_all_providers [smile]
<br>me: hmm, I didn&#39;t see that but I&#39;ll check again.<br>&nbsp;<br><br><br>