NordicSemiconductor / IOS-nRF-Connect-Device-Manager

A mobile management library for devices supporting nRF Connect Device Manager.
https://www.nordicsemi.com/Software-and-tools/Software/nRF-Connect-SDK
Apache License 2.0
90 stars 41 forks source link

Upgrade successful but upgradeDidComplete does not fire #69

Closed RickGroenewegen closed 1 year ago

RickGroenewegen commented 2 years ago

I'm able to fully upgrade the firmware using this library.

However, upgradeDidComplete does not fire. Instead I'm getting an error:

2022-08-01 11:39:46.160235+0200 App[4548:292971] [CoreBluetooth] XPC connection invalid

However, when I comment line 252 in FirmwareUpgradeManager it does work. Line 252 sets the cyclicReferenceHolder to nil:

cyclicReferenceHolder = nil

Seems like the reference is removed too quickly or something for upgradeDidComplete to finish?

scsonic commented 2 years ago

the mcumgr in android will fire Complete but the ios not, same error here

scsonic commented 2 years ago

Thansk Rick's information finally, my solution is

DispatchQueue.main.async { [weak self] in
    self?.delegate?.upgradeDidComplete()
    self?.cyclicReferenceHolder = nil
}
RickGroenewegen commented 2 years ago

Thanks scsonic!

I've created a PR:

https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager/pull/72

dinesharjani commented 1 year ago

PR was merged. Closing for now.