Question: When the BLE device is advertising, it can be found normally by Android and iOS phones with apps such as CySmart and Lightblue. However, when I use the Bluetooth on the phone without these apps, only Android devices discover the device; iOS devices do not. How do I make the BLE device discoverable by iOS devices?
Answer: When you design a BLE device communicating with Apple products such as iPhone, iPad, and Mac, you must follow Apple’s design guidelines. To establish and maintain a successful connection, you must follow both the specifications of Bluetooth SIG and Apple’s guidelines. These guidelines define the role, advertising PDU, advertising interval, connection parameters, data packet length extension, privacy, permissions, pairing, MTU size, services, and GATT Server for the BLE device. A BLE implementation on an iOS device differs from that on an Android device in parameters such as advertising PDU, advertising data, advertising interval, connection parameters and privacy.
- Advertising PDU: the iOS device does not support the ADV_DIRECT_IND advertising PDU. Use only one of the three advertising PDUs: ADV_IND, ADV_NOCONN_IND, and ADV_SCAN_IND.
- Advertising Data: The advertising data should contain at least the TX power level, local name, and services flags.
- Advertising Interval: The recommended advertising pattern and advertising intervals are as follows:
First, advertise at 20-ms intervals for at least 30 seconds. If not discovered after 30 seconds, you may change to one of the following longer intervals: 152.5 ms, 211.25 ms, 318.75 ms, 417.5 ms, 546.25 ms, 760 ms, 852.5 ms, 1022.5 ms, 1285 ms. These exact specific intervals must be used. Even the slightest deviation may significantly increase the time to discovery.
4. Connection Parameters: The parameters must follow certain rules and formulas. Some iOS devices scale the interval to 30 ms to balance power and performance constraints if you set Interval Min == Interval Max == 15 ms. The connection interval down to 11.25 ms may be accepted if the connected services include the HID service. The iOS device will not read or use the parameters in the Peripheral Preferred Connection Parameters characteristic, so the peripheral should send an L2CAP Connection Parameter Update Request if you need to update the connection parameters. The rules of the connection parameters are as follows:
- Interval Min ≥ 15 ms (multiples of 15 ms)
- Interval Min + 15 ms ≤ Interval Max (Interval Max == 15 ms is allowed)
- Interval Max * (Slave Latency + 1) ≤ 2 seconds
- Interval Max * (Slave Latency + 1) * 3 < connSupervisionTimeout
- Slave Latency ≤ 30
- 2 seconds ≤ connSupervisionTimeout ≤ 6 seconds
5. Privacy: iOS devices use a random device address in all situations, so the peer device must be able to resolve a Resolvable Private Address in all situations.
See the Apple design guidelines for more details: https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf