Clean up Shearwater string handling

Dirk Hohndel dirk at hohndel.org
Sun Jul 9 13:11:17 PDT 2017


On Sun, Jul 09, 2017 at 01:03:16PM -0700, Linus Torvalds wrote:
> 
> 
> Look again.
> 
> That's a *bitmap* of the states we've seen.
> 
> So state 0 becomes *bit* zero, which has value 1.
> 
> State 1 (critical) becomes bit 1, so value 2.
> 
> Those boots come in every sample. So normal and critical means that at saw
> different samples - some with normal battery and some with critical.

boots? :-)
Autocorrect is so much fun.

> And that *is* meaningful, and it's interesting data - it may mean that the
> battery is on the edge.

Yes. It's so annoying that you have this tendency to be right.
Stop that.

> Also, the four upper bits may end up having other meaning too. I didn't
> want to bother putting in the "no communication" state bits, because I
> wonder whether you might get those at the beginning and/or end of dives,
> but it might we'll be interesting to see that you lost communication during
> the dive for a while. Again, that shouldn't overwrite the other cases, but
> exactly *because* this is a bitmap of all the states we've seen, it's quite
> reasonable and possible.
> 
> So please rethink.

Rethought. I misunderestimated your brilliance. As usual.

> What if the transmitter was critical during the middle of the dive because
> it got cold, but then warmed up as you ascended, and was only warning at
> the end of the dive? Your code - because it only remembered one value -
> couldn't handle that.
> 
> The bitmap code handles it very naturally, along with other potential flags.

I'll take it.

/D


More information about the subsurface mailing list