From 49ae623befcde620e8a3060d2d2716274afab03b Mon Sep 17 00:00:00 2001 From: SangYoun Kwak Date: Thu, 13 Jun 2024 16:00:05 +0900 Subject: Modify upgrade state transition The simplified upgrade state model is used, the transition rule should be modified. Change-Id: I63cfa6e41eadbf40a7e3cc139838a3dcfeed2c95 Signed-off-by: SangYoun Kwak --- src/hal-api-device-board.c | 54 +--------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/src/hal-api-device-board.c b/src/hal-api-device-board.c index 30d0efe..00dac68 100644 --- a/src/hal-api-device-board.c +++ b/src/hal-api-device-board.c @@ -301,19 +301,12 @@ int hal_device_board_get_upgrade_progress_status(int *status) #define UPGRADE_STATE_STANDBY "standby" #define UPGRADE_STATE_READY "ready" -#define UPGRADE_STATE_READY_FAILED "ready_failed" -#define UPGRADE_STATE_RO_UPGRADING "ro_upgrading" -#define UPGRADE_STATE_RO_FAILED "ro_failed" -#define UPGRADE_STATE_RO_UPGRADED "ro_upgraded" -#define UPGRADE_STATE_RW_UPGRADING "rw_upgrading" -#define UPGRADE_STATE_RW_FAILED "rw_failed" -#define UPGRADE_STATE_RW_UPGRADED "rw_upgraded" #define UPGRADE_STATE_COMPLETED "completed" struct upgrade_state { char *state; size_t next_size; - char *next[3]; + char *next[2]; }; static struct upgrade_state upgrade_states[] = { @@ -326,53 +319,8 @@ static struct upgrade_state upgrade_states[] = { }, { .state = UPGRADE_STATE_READY, .next_size = 2, - .next = { - UPGRADE_STATE_READY_FAILED, - UPGRADE_STATE_RO_UPGRADING, - }, - }, { - .state = UPGRADE_STATE_READY_FAILED, - .next_size = 1, .next = { UPGRADE_STATE_READY, - }, - }, { - .state = UPGRADE_STATE_RO_UPGRADING, - .next_size = 2, - .next = { - UPGRADE_STATE_RO_FAILED, - UPGRADE_STATE_RO_UPGRADED, - }, - }, { - .state = UPGRADE_STATE_RO_FAILED, - .next_size = 1, - .next = { - UPGRADE_STATE_READY, - }, - }, { - .state = UPGRADE_STATE_RO_UPGRADED, - .next_size = 1, - .next = { - UPGRADE_STATE_RW_UPGRADING, - }, - }, { - .state = UPGRADE_STATE_RW_UPGRADING, - .next_size = 3, - .next = { - UPGRADE_STATE_RW_UPGRADING, - UPGRADE_STATE_RW_FAILED, - UPGRADE_STATE_RW_UPGRADED, - }, - }, { - .state = UPGRADE_STATE_RW_FAILED, - .next_size = 1, - .next = { - UPGRADE_STATE_READY, - }, - }, { - .state = UPGRADE_STATE_RW_UPGRADED, - .next_size = 1, - .next = { UPGRADE_STATE_COMPLETED, }, }, { -- cgit v1.2.3