Maximum number of peripherals on CoreBluetooth?
Theoretically, there is no limit to the number of Bluetooth LE devices that can be connected to a single iOS device (if the iOS device is acting as central and the LE devices as peripherals).
In practice, however, the limit seems to be somewhere above 20 LE devices being connected simultaneously to the iOS master. That number comes from both Bluetooth LE transmitter manufacturers and accessory developers that I've talked to. The exact figure will probably vary based on the particular iOS device involved and the transmitting properties of the Bluetooth LE accessories.
How many devices we can pair via Bluetooth to iPhone?
As it stands in iOS 6.1.4, the current limit for Bluetooth Low Energy devices is 10 simultaneous CONNECTIONS (at least on the NRF8002 chipset). Although the BLE spec says it can in theory have an infinite number of connections, the connection will time out when you try to add an 11th device.
As for the pairing table, I've previously had two additional a2dp devices in my pairing table(not connected) and 10 current BLE connections as the maximum. So that is a total of 12 devices in the pairing table on an iPhone 5 running iOS 6.1.4. You could probably have more devices listed in the pairing table, but the one definite is 10 connections is the current max.
My Corebluetooth framework is connecting to multiple device
When this code discovers a peripheral, it tries to connect to it. I don't see anywhere that it stops scanning, and it doesn't avoid connecting just because it's connected.
If you don't want to keep scanning after you discover something, call stopScanning()
. If you don't want to connect when you're already connected (or connecting), then don't call connect()
in those cases.
Core Bluetooth scan for peripherals while the phone's screen is off
This is not possible.
When you tick 'Uses Bluetooth LE accessories'
and 'Acts as a Bluetooth LE accessory'
, when iPhone screen light is turned off, core bluetooth framework stops advertising and scanning. It resumes advertising/scanning once the screen light turns back on. That's the maximum possible achievable scenario in iOS.
If you want to take this further, you can use beginBackgroundTaskWithExpirationHandler
- https://developer.apple.com/documentation/uikit/uiapplication/1623031-beginbackgroundtaskwithexpiratio but that works hardly for 3 minutes. Those 3 minutes start as soon as the app goes from foreground to background.
For saving battery, iOS seems to automatically turn off the BLE hardware and it goes back on as soon as the device moves/screen wakes up. Because when screen is off, user isn't using the iPhone anyway.
Edit: Unless a device is connected, like a headphone- Though not advertising, existing connected devices can share data.
Related Topics
How to Install iOS 7.0 and iOS 8.0 Simulators in Xcode 6.1
Having App Restart Itself When It Detects Change to Privacy Settings
Change the Root View of Uihostingcontroller in Swiftui
Uiimagepicker Cameraoverlayview Appears on Retake Screen
Flutter on iOS: Fatal Error: Module 'Cloud_Firestore' Not Found
Leaking Views When Changing Rootviewcontroller Inside Transitionwithview
When Does Awakefromnib Get Called
Main.Async VS Main.Sync() VS Global().Async in Swift3 Gcd
How to Change Status Bar Style - iOS 12
Nsnotificationcenter Swift 3.0 on Keyboard Show and Hide
Determine User's "Temperature Unit" Setting on iOS 10 (Celsius/Fahrenheit)
Combine Two String in Different Language Rtl & Ltr