I need to totally management the BLE ship timing myself, as an alternative of counting on the iOS system.
When I attempt to ship a big information block utilizing BLE (i.e., splitting it and sending a number of instances), I observe Apple’s official information. Nevertheless, after the primary profitable updateValue()
name in my loop, the second name at all times fails until I look ahead to the peripheralManagerIsReady(toUpdateSubscribers:)
callback. This callback timing is managed by the system, so I can’t management precisely once I can ship the following packet.
If I ship information manually by clicking a button, updateValue()
at all times returns true—even when I add a protracted delay (like sleep(10)
) between calls. However in a loop, after the primary ship, updateValue()
returns false till the thread leaves or the callback happens. I think this can be a thread or queue concern blocking subsequent sends.
I additionally tried utilizing DispatchQueue.world().async {}
within the loop, however the end result is similar.
Is there any approach to totally management once I name updateValue()
, with out ready for peripheralManagerIsReady()
? Or is that this a limitation of iOS BLE?
Thanks!