<div class="gmail_quote">On Thu, Jul 30, 2009 at 8:26 AM, Laurens Van Houtven <span dir="ltr"><<a href="mailto:lvh@laurensvh.be">lvh@laurensvh.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Jul 30, 2009 at 3:01 AM, Glyph Lefkowitz<<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>> wrote:<br>
</div><div class="im">
> I've attached a sketch<br>
</div>Extremely helpful, thank you.</blockquote><div><br>You're welcome.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">To be honest, it<br>
still looks kind of wonky that a LineReceiver (well, a subclass)<br>
delegates to a receiver, but maybe that's just my inexperience showing<br>
:-)<br>
</blockquote><div><br>Does it also bother you that 'dataReceived' delegates to 'lineReceived'? :)<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What exactly would those<br>
startReceivingNMEA/stopReceivingNMEA/startReceivingPositions/stopReceivingPositions<br>
do? I don't think there's any setup to be done, so I guess that I<br>
should just have an instance attribute on the appropriate class that<br>
is set by startFoo/stopFoo. If it's false, callbacks don't fire.<br>
Right?<br>
<div class="im"></div></blockquote><div> <br>You don't need to do anything at all in these callbacks. The important point is to provide them, so that applications which, for example, wish to show a little "GPS active" icon will know when data starts and stops arriving. Also important so that an application can re-connect or re-initialize the device or whatever, without hooking implementing multiple interfaces and hooking in at multiple levels.<br>
<br>Given that data for positioning may come from a variety of sources it's important to have a positioning-specific method that marks the start and stop, rather than depending on connectionMade or similar. One could for example imagine a hypothetical HTTP-polling-based positioning provider which would have a connectionMade for every sentence of data, but that wouldn't represent a start and a stop at the positioning level. start would simply be called before the first position, and stop would be called after a timeout or after certain varieties of HTTP error.<br>
</div></div>