<html><head></head><body><div dir="auto">My code is beautiful. And creative.<br></div>
<div dir="auto">So there.<br><br></div>
<div dir="auto">I'll look at this tomorrow. I'm done working on Subsurface for today.<br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->-- <!-- tmjah_g_1299e --><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->From my phone<!-- tmjah_g_1299e --></div>
<div  style="font-size:10.0pt;font-family:"Tahoma","sans-serif";padding:3.0pt 0in 0in 0in">
<hr style="border:none;border-top:solid #E1E1E1 1.0pt">
<b>From:</b> Linus Torvalds <torvalds@linux-foundation.org><br>
<b>Sent:</b> Sat Jul 08 20:27:53 PDT 2017<br>
<b>To:</b> Dirk Hohndel <dirk@hohndel.org><br>
<b>Cc:</b> Subsurface Mailing List <subsurface@subsurface-divelog.org><br>
<b>Subject:</b> Clean up Shearwater string handling<br>
</subsurface@subsurface-divelog.org></dirk@hohndel.org></torvalds@linux-foundation.org></div>
<br>
<pre class="blue">Dirk, you added that nasty and disgusting<br><br>  SAMPLE_VENDOR_SHEARWATER_TRANSMITTERDATA<br><br>thing because you didn't realize how the Shearwater parsing actually works.<br><br>It parses the whole dive when it does the header, so it's quite easy<br>to actually make that part do the transmitter status too, and to just<br>return it as a proper string using the nice DC_FIELD_STRING interface.<br><br>Of course, the shearwater code didn't do that DC_FIELD_STRING thing<br>very nicely for any of the other data either, so I rewrote that logic<br>to just match what the EON Steel does. The EON Steel way is the right<br>way to do that thing - parse it once, and fill in the info, and then<br>the DC_FIELD_STRING fetching just picks out the string data directly.<br><br>We could try to share the "add_string()" and "add_string_fmt()"<br>functions between the two, but that's a separate cleanup thing (and it<br>requires us to come to some agreement about the string array sizes)<br><br>In the meantime, this patch gets rid of the nasty vendor sample thing,<br>and returns the transmitter battery info as a string. It also fixes<br>some ugly duplication of the other string values.<br><br>It WorksForMe(tm), but since my test dive on my Perdix AI doesn't have<br>any actual pressure data, thats' not really saying much.<br><br>Can you give this a try? If it works for your dives that actually have<br>transmitter data, please let me know, and I can commit it and push it<br>out.<br><br>And then you can remove that nasty hack from subsurface too. Eww.<br><br>                         Linus<br></pre></body></html>