Hello, I'm troubleshooting why my custom Bluetooth peripheral won't connect to my iPad. My Bluetooth peripheral is named "0471". I installed the Bluetooth profile and exported the system diagnostic logs from the iPad to troubleshoot the connection. Here are the relevant system logs from my iPad.
- 0471 connecting:
default 2024-08-05 13:28:53.664196 -0500 bluetoothd Device connecting - {cbuuid: 0BB0FBE0-F708-23DD-B310-E487518668BE, devicename: Reader 0471, result: 0, adv-addr: 4C:5B:B3:85:CD:D6-Public, resolved-addr: }
- 0471 failure to connect:
default 2024-08-05 13:28:53.987319 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
default 2024-08-05 13:28:59.673271 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
default 2024-08-05 13:29:08.684653 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
- Another connecetion attempt to 0471
default 2024-08-05 13:29:18.985399 -0500 bluetoothd Device connecting - {cbuuid: 0BB0FBE0-F708-23DD-B310-E487518668BE, devicename: Reader 0471, result: 0, adv-addr: 4C:5B:B3:85:CD:D6-Public, resolved-addr: }
- 0471 failed to connect again
default 2024-08-05 13:29:24.993122 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
default 2024-08-05 13:29:27.449115 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
default 2024-08-05 13:29:33.992337 -0500 bluetoothd handleConnectionCompleteCallback address=Public 4C:5B:B3:85:CD:D6 handle=0x0 status=702 connectionIsActive=0, wakeupEvent=0
- State dump of 0471
default 2024-08-05 13:30:52.056771 -0500 bluetoothd statedump: 0BB0FBE0-F708-23DD-B310-E487518668BE → Public 4C:5B:B3:85:CD:D6, Adv.Name: "Reader 0471", LastSeen: 71.12s ago, CoexPriority: 2, DIS:Unavailable, EstablishedFastLeConnection:N, linkReadyDuration:0ms (added to WL 0.000 ago) disableDisconnect:0 useCase:23 scanDutyCycle screenON:0 screenOFF:3 pendingDelete:0 type:Other FindMy:
default 2024-08-05 13:30:52.073019 -0500 bluetoothd statedump: 0BB0FBE0-F708-23DD-B310-E487518668BE → Public 4C:5B:B3:85:CD:D6, Adv.Name: "", LastSeen: 22881591
What does handleConnectionCompleteCallback's status 702 mean? Any leads on why the connection failed?
status=702 corresponds to HCI Error 0x02: Unknown Connection Identifier
This is usually caused by the connection being dropped/failed while the handshake is still going on. You will want to check a packet log to see exactly at what point things have failed.
If you don't have a packet logger, on iOS side the sysdiagnose also includes a packet log. You can find it within the sysdiagnose folder -> Logs -> Bluetooth
You can open that file with the PacketLogger app, which you can obtain from https://developer.apple.com/download/all/ and in the package Additional Tools for Xcode ... which corresponds to the version of Xcode you are running.
Additionally you would want to use any debugging tools you have for the custom peripheral, as the problem is going to be very likely there. Perhaps and unexpected timeout, or the peripheral rejecting the connection because iOS did not respond with the requested parameters (we see that a lot)
Argun Tekant / DTS Engineer / Core Technologies