piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 52 forks source link

Fix error management in DfuService (for PineTime/InfiniTime) #238

Closed JF002 closed 2 years ago

JF002 commented 2 years ago

If an error occurs during the OTA for the PineTime running InfiniTime, the variable m_operationRunning is still set to 1, which prevents the user from restarting the transfer. This PR fixes that by adding a new signal DfuOperation::transferError. When emitted, the slot in DfuService::onTransferError correctly sets the variable to 0.

I also took the opportunity to store m_updateFirmware in a unique_ptr to ensure that it's correctly destroyed in every cases.

piggz commented 2 years ago

Thanks!

What is ttt doing, and could (should?) it be moved to a member variable?

JF002 commented 2 years ago

ttt is probably a debug variable I forgot to remove. I'll check that (and fix conflicts) asap!

JF002 commented 2 years ago

I've just removed the debug code (the variable ttt) and rebased everything on master to fix the conflicts ;-)