How to enable scanning with feature: extendedScanAndConnect

352 views Asked by At

I saw that started from iOS 13 we can scan for extended advertisement packet.

In Core Bluetooth documentation I have found:

class func supports(_ features: CBCentralManager.Feature) -> Bool 

static var extendedScanAndConnect: CBCentralManager.Feature { get }

but I don't know how to enable extended scanning?

Maybe it's set by default on devices which support it?

I can't even check even this because I don't have a device which are support it.

Could you help me?

1

There are 1 answers

0
Alain Stulz On

I inquired with Apple about this feature, this is the response I got from DTS:

CBCentralManager.Feature.extendedScanAndConnect is what we call a dynamic feature, that changes from device model to device model, and can change as different radio chipsets could be getting used in different models, and support can be enabled or disabled depending on the iOS version.

As such, we don’t have a list that you can use to determine whether it is supported or not. That’s why it is gated behind the supportsFeatures() call, so your app can dynamically determine on the device it runs on. If you wanted to test it, you can use an iPhone 13 Pro, which does have support. But to actually be able to use the feature, the advertising peripheral must also support extended advertising and connections.

The extended scan and connection is a link layer capability and does not enable anything different for your app. It is informative only to indicate that the iOS device will scan for and recognize extended advertising packets from the peripheral. The capabilities include longer advertising packets (254 bytes vs 31), chained advertising packets for longer data, synchronized advertising. Not all of these features are guaranteed to be enabled on every device/iOS combinations. Even if it returns YES or NO to the feature now, it is not guaranteed that the same device will return the same result in the future.

The only behavior difference you might notice is the lack of the secondary didDiscover() callback for an advertisement if a SCAN_RSP packet for more data is deemed no longer necessary.