Skip to content

Commit

Permalink
mgmt: hawkbit: also use workqueue for shell run
Browse files Browse the repository at this point in the history
Also use a workqueue, when execution of
hawkBit is requested via shell.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Apr 15, 2024
1 parent f0eee49 commit eb65c58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/mgmt/hawkbit/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ static void cmd_run(const struct shell *sh, size_t argc, char **argv)
ARG_UNUSED(argv);

shell_fprintf(sh, SHELL_INFO, "Starting hawkBit run...\n");
switch (hawkbit_probe()) {
hawkbit_autohandler(false);

switch (hawkbit_autohandler_wait(__UINT32_MAX__, K_FOREVER)) {
case HAWKBIT_UNCONFIRMED_IMAGE:
shell_fprintf(
sh, SHELL_ERROR,
"Image is unconfirmed."
"Rebooting to revert back to previous confirmed image\n");
hawkbit_reboot();
break;

case HAWKBIT_CANCEL_UPDATE:
Expand All @@ -42,7 +43,6 @@ static void cmd_run(const struct shell *sh, size_t argc, char **argv)

case HAWKBIT_UPDATE_INSTALLED:
shell_fprintf(sh, SHELL_INFO, "Update Installed\n");
hawkbit_reboot();
break;

case HAWKBIT_DOWNLOAD_ERROR:
Expand Down

0 comments on commit eb65c58

Please sign in to comment.