Connection Interval Core Bluetooth

后端 未结 3 1589
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 01:28

Is there any way to change connection interval through Core Bluetooth? I am transferring chunks of data to Peripheral and it\'s talking much time to transfer the data. I want to

3条回答
  •  执笔经年
    2021-01-21 01:53

    [_manager setDesiredConnectionLatency:CBPeripheralManagerConnectionLatencyLow forCentral:_central];
    

    I used this method on the iOS Peripheral app I created. You still can't get below 20ms though. Very frustrating as I need to be below 16ms. Doesn't look possible for now unless it's a HID profile (they allow 11.25ms) — but you can't create a HID profile from an iOS device.

    If you have an iOS device on the other end of your Bluetooth Smart link, Apple imposes its own restrictions on the minimum connection interval. This value is 20ms rather than the official Bluetooth 4.0 specification minimum of 7.5ms. Apple does this to ensure that a single app doesn't take over all available bandwidth on the Bluetooth hardware, and/or kill the battery too quickly. For details on this restriction, see the Connection Parameters section on page 18 of the Apple Bluetooth Design Guidelines (PDF).

    Note that iOS does not allow you to set or request connection parameters from the iOS end of things. The CoreBluetooth CBCentralManager object's connectPeripheral method takes an "options" parameter, but this does not include connection parameters. Instead, the slave must request a connection update with new desired parameters after connecting, and then iOS will either accept or reject them based on the criteria in the Design Guidelines document linked above.

提交回复
热议问题