No connectionEventDidOccur for GATT over BR/EDR (aka Classic) using CoreBluetooth


I’m trying to use the iOS 13 introduced capability in CoreBluetooth to do GATT over BR/EDR.

The accessory I’m using obviously implements GATT over BR/EDR (it even publishes its services using SDP).

According to the session WWDC 2019 What’s New in Core Bluetooth session, we have to use the registerForConnectionEvents API on a CBCentralManager instance, providing services UUIDs (CBUUIDs) that will be available to use on the BR/EDR accessory.

In the session, they explicitly say:

Your app will have instantiated a CBCentralManager, passed us a known
service UID, and in the case of a BR/EDR or classic device, your user
will go to the Bluetooth settings and search for the device, in this
case let’s say it’s a headset running heart rate.

They’ll discover the device, find it, and attempt to connect.

Pairing will be triggered, and then afterwards when we’re connected,
we’ll run a service discovery of the GATT services.

If we find a service that you want, then you’ll get the delegate

So when doing a manual connection in the Settings app to the accessory, iOS does a GATT service discovery and if it matches, we receive an associated connectionEventDidOccur delegate callback with the event (peerConnected) and the associated CBPeripheral.

However, this delegate callback never happens.

I’m using the UsingCoreBluetoothClassic sample from Apple, with custom service CBUUIDs implemented by my accessory.
I did multiple attempts: providing only one service CBUUID, severals CBUUIDs, none, generic ones, very specific ones… It never fires.

Note that on Android, it seems to work: connection is possible using the MAC address directly, and a service discovery using SDP lists the accessory services.

Also note that the event fires when I’m scanning using scanForPeripherals and connect to my accessory (because my accessory also does GATT over BLE, but for specific reasons we explicitly want to perform GATT over BR/EDR).

Is there something I have to do on the accessory that I probably missed ?

Source: Ios Questions

Categorised as core-bluetooth, ios Tagged ,


Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us