I have a complete implementation of OTA DFU where iOS app performs a DFU to a nRF based BT Device. Now i am implementing a fix for the situation where:
- During DFU, if peripheral's power turns off.
The desired behavior is when the disconnection happens, Central (iOS app) should wait 10 seconds and performs another scan. If the device is broadcasting (in application mode), automatically connect and resume the firmware update process.
Now for that, i am checking if an unexpected disconnection happens at dfuError method of DFUServiceDelegate. dfuError triggers properly, I then rescan for peripherals in 10 seconds and try to connect. I manage to connect to the peripheral (as i see it is not broadcasting any longer) but the didConnect method of Central Manager Delegate doesn't get called.
My question is if we need to do something special to clear the central manager or DFUServiceInitiator after a dfuError occurs? It seems like even after dfuError (upon disconnection), iOS SDK thinks that the device is still connected. That is why didConnect method of CentralManagerDelegate doesn't get called.
Any thoughts?