<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 26-05-17 21:49, Jan Mulder wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:5ea50f0e-3bc4-2757-5adc-8df979837a07@xs4all.nl">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div class="moz-cite-prefix">On 26-05-17 18:11, Tomaz Canabrava
        wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CACk01_yMOqy98BO19Kvr9AtXgkchMYnwyfdj+gNw_yj2h6xYtw@mail.gmail.com">
        <div dir="ltr">
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>Today I made  a breakthrougth and I can
                            actually download the dives on the mobile
                            version.<br>
                          </div>
                          The code is 100% shared with the desktop
                          version, so nothing new was written to support
                          that, this means that I kept code written to a
                          minimum (moving things around, creating some
                          helper classes to deal with desktop and
                          mobile), for instance.<br>
                          <br>
                        </div>
                        Some points:<br>
                      </div>
                      1 - the deviceName currently is hardcoded to
                      "/tmp/ttyS1"<br>
                    </div>
                    2 - I tested with the simulator since I don't have a
                    BT hardware<br>
                  </div>
                  3 - Bt is not done nor tested.<br>
                </div>
                4 - The downloaded dives are not being save yet.<br>
                <br>
              </div>
              I'm going to the Opensuse Conf this weekend, so I'm not
              sure if I will have the time to hack on this on the
              weekend, but if you guys wanna help, my branch is in
              https://github.com:tcanabrava/subsurface.git /
              DiveComputerQml<br>
              <br>
            </div>
            picture to proof.<br>
            <br>
          </div>
          Tomaz<br>
        </div>
      </blockquote>
      <br>
      I have tried the following:<br>
      1) mobile on desktop, reading from the libdc simulator =>
      working (as expected),<br>
      2) mobile on desktop,reading from OSTC3 over BT. For this, I
      hardcoded the BT address of my OSTC, and set the BT mode to true
      (obviously). The OSTC goes correctly in download mode, and stays
      there for multiple minutes. The console finally shows "<span
        style=" color:#808000;">Finishing the thread dives downloaded
        125". </span>So, the next breakthrough today :-) The first
      download over BT from a real dive computer :-) And most
      impressive, without changing any of the code from Tomaz.
      Obviously, there is something needed: a progress (toast) style
      thingy, or any other indication that it is downloading. Further, I
      was downloading in my normal logbook, so I did not expect any
      dives downloaded that were already downloaded (without looking to
      any code at this point).<br>
      3) mobile on mobile ... ok, this is not working yet. I verified
      that pairing is ok, and I can trigger a download over my mobile
      (using terminal input), so raw serial traffic. So the two devices
      can communicate. It seems that subsurface mobile is not attempting
      any communication.<br>
      <br>
      --jan <br>
      <style type="text/css"> p, li { white-space: pre-wrap; Finishing the thread  dives downloaded 125</style>
      <style type="text/css">p, li { white-space: pre-wrap; }Finishing the thread  dives downloaded 125</style>
      <br>
    </blockquote>
    <br>
    And some more progress. Just downloaded 125 dives from my OSTC3 to
    the mobile app on my phone. Ok, all device specific stuff is hard
    coded at this point. The reason that 3) above did not work is that
    we have to open the socket based on  uuid as port number is not
    supported on Android. So in, qtserialbluetooth.cpp we need to
    something like:<br>
    <br>
        QLatin1String serviceUuid(<the UUID of the already paired
    divecomputer>);<br>
        QBluetoothAddress remoteDeviceAddress(<the BT address of the
    paired divecomputer>);<br>
        QBluetoothUuid uuid(serviceUuid);<br>
        serial_port->socket->connectToService(remoteDeviceAddress,
    uuid, QIODevice::ReadWrite | QIODevice::Unbuffered);<br>
    <br>
    Thinking of some QML and other things:<br>
    - it might be nice when the list of dive computers is filtered (in
    the BT case) to the set of paired dive computers. Why bother the
    user with a long list of dive computers that are not paired (so not
    ready for communication)? Obviously, I am assuming that pairing will
    be done at OS/Android level, and not in the mobile app.<br>
    - the list of downloaded dive on the phone looks crap. Font sizing
    is way off. <br>
    <br>
    that's all for today, now time from a nice dive on this almost
    tropical day in the Netherlands.<br>
    <br>
    --jan<br>
  </body>
</html>