<div dir="ltr">Hello,<div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
</span>Just to make sure we get the terminology straight... the "local device" is<br>
your computer or tablet or whatever Subsurface is running on, the "remote<br>
device" is the BT dive computer, correct?<span class=""><br></span></blockquote><div><br></div><div><div>When I said the local device I was referring to the local Bluetooth device</div><div>where the Subsurface is running on. The remote device is the dive computer</div><div>which has support for Bluetooth.</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
</span>I assume that means turn on/off BT support on your computer?</blockquote><div><br></div><div>Yes, that is what I meant to say. I should have been more specific.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
This message seems off as a user facing message. The QtConnectivity<br>
libraries would have come with the install - either as dependency or Linux<br>
or bundled with the executable on Windows / Mac. What other reasons could<br>
there be for this test failing? Bluetooth turned off maybe?<br>
Think of this as something you tell the user so she can fix it...<br>
<br></blockquote><div><br></div><div><div>If the Bluetooth is turned off it wouldn't be a problem. I faced this issue</div><div>when I played with the BlueZ and Qt versions and the Qt framework couldn't</div><div>connect to the local Bluetooth device using the BlueZ stack. One of the reasons </div><div>was that that the qtconnectivity library was missing or the BlueZ was not</div><div>installed correctly. </div><div>If the dependencies are installed correctly this should never happen.</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Many BT UIs do that... I always wonder if it wouldn't be better NOT to<br>
show the hex address if you have a name...<br></blockquote><div><br></div><div>Probably they use the address because it is unique. Two Bluetooth devices</div><div>may have the same name and you could easily choose the wrong one. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
So the close function above frees the device when it closes it.<br>
Is the caller required to set it to NULL? Because if someone<br>
passes a device to close() (and the memory gets freed) and then<br>
to read() (admittedly a bug) then you dereference freed memory<br>
here.<br>
<br>
I guess that's just how the API works?<br></blockquote><div><br></div><div><div>Yes, you are right. I should probably set the device to NULL after </div><div>the memory was freed. For the moment this is not a problem </div></div><div>because the close method is called on libdivecomputer project</div><div>and after this happens no other operations are called. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Not having looked at the API in enough detail... but to me<br>
"get_transmitted()" sounds like how much has been transmitted,<br>
whereas "bytesToWrite()" sounds like a count of data in a queue...<br>
<br></blockquote><div><br></div><div><div>The bytesToWrite function returns the number of bytes that are </div><div>waiting to be written. The native serial implementation uses</div><div>the ioctl TIOCOUTQ command to get the number of bytes in the</div><div>output buffer so I though that it would be ok if I will use</div><div>the bytesToWrite method to get the expected results.</div></div><div> </div><div><br></div><div><div>Sorry if the messages from the commits had some spelling issues</div><div>or if they were too coincise but I spend a lot of time to resolve</div><div>the merging conflicts and after a while I decided that it would be</div><div>a lot easier for me to create a new branch and to commit again my </div><div>sources :-).</div></div><div><br></div><div>Claudiu</div><div><br></div></div></div></div></div>