Index: sources/update/Package.cpp =================================================================== diff -u -rf0118ee7e526bb64e9f78059f030929792a5a98a -r61c46e9379ca82d826fbe7fae018b8362a107d9d --- sources/update/Package.cpp (.../Package.cpp) (revision f0118ee7e526bb64e9f78059f030929792a5a98a) +++ sources/update/Package.cpp (.../Package.cpp) (revision 61c46e9379ca82d826fbe7fae018b8362a107d9d) @@ -18,6 +18,7 @@ #include #include "IDataProvider.h" #include "UiSwUpdate.h" +#include "UiProtocol.h" #include #include @@ -668,6 +669,23 @@ } /*! + * \brief Reboot to run the firmware (both HD and DG) apps if they are valid. + */ +void Package::rebootFW() { + const int retryRebootEffort = 4; + SwUpdate::MsgLink link(KBPS_WIRE); + + for (std::size_t ii = 0; ii < 2; ii++) { + SwUpdateCommand msg; + msg.id = SwUpdate::UiProtocol::getNextMsgSlotId(); + msg.cmd = SwUpdate_FormCommand(ii == 0 ? HD : DG, RunApp); + msg.rand = SwUpdate::UiProtocol::getNextMsgSeed(); + SwUpdate_createSecurity((uint8 *)&msg, sizeof(SwUpdateCommand)); + link.sendOk(SwUpdateCanMsgIds::CommandId, (uint8 *)&msg, retryRebootEffort); + } +} + +/*! * \brief Scan a directory recursively for regular files and avoid links. * * \param directory The directory to scan.