pebble/pebble-ios-sdk

Choose BluetoothLE over Bluetooth-Classic more reliably

jeradesign opened this issue · 2 comments

Start app.
Connect to watch.

One of the following messages will appear in the console:

Not opening a session for <PBBTLEWatchTransport: 0x14e227fe0 identifier=LE-2FB28688-CE8C-4935-B668-479F4D29184F name=Pebble Time 5C53 serialNumber=Q303195E0074> - no free/matching App-UUID found.

  • or -

Not opening a session for <PBBTClassicWatchTransport: 0x13f25bd90 identifier=iAP-shared name=Pebble Time 5C53 serialNumber=Q303195E0074> - no free/matching App-UUID found.

There seems to be no rhyme or reason as to which is selected. Consecutive launches of the iOS app often have the opposite transport selected.

Hi John,

Those messages are a little bit “dramatic” but nothing is actually going wrong. We need to find devices using either Classic or LE, and the watch also tries to connect both transports. If a watch that support both transports manages to connect the second transport, you might see those messages, basically telling you that we already have a communication channel open for that App UUID, and that the new transport will be ignored.

There is no way right now to “stick” with one transport or the other. We try to “prefer” LE, but if Classic connects first, sometimes Classic wins. The idea is keeping the watch always connected using either transport.

For several reasons, we cannot know if LE will connect correctly even if it was connected before. The iOS BT settings and the watch BT settings are basically unknown to PebbleKit, and we have to do guess work before being able to connect (the user might have removed the pairing and recreated it, but your PebbleKit app still has a reference to the old pairing, that we have to discover stale, and then find out the new pairing). As we move forward, LE will start being more and more the preferred transport, and hopefully you will not need to worry about the iAP-shared session.

Tell us what you think and if we can close this issue. Thanks!

PebbleKit 4.0.0 removes the option of using Bluetooth Classic, so the apps will always use Bluetooth LE. This issue should not happen anymore.