<div class="gmail_quote">On Thu, Jul 30, 2009 at 8:26 AM, Laurens Van Houtven <span dir="ltr">&lt;<a href="mailto:lvh@laurensvh.be">lvh@laurensvh.be</a>&gt;</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&lt;<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>&gt; wrote:<br>
</div><div class="im">
&gt; I&#39;ve attached a sketch<br>
</div>Extremely helpful, thank you.</blockquote><div><br>You&#39;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&#39;s just my inexperience showing<br>
:-)<br>
</blockquote><div><br>Does it also bother you that &#39;dataReceived&#39; delegates to &#39;lineReceived&#39;? :)<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&#39;t think there&#39;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&#39;s false, callbacks don&#39;t fire.<br>
Right?<br>
<div class="im"></div></blockquote><div> <br>You don&#39;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 &quot;GPS active&quot; 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&#39;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&#39;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>