%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_progress_status
%attr(0554,system_fw,system_fw) %{_bindir}/device_board_set_upgrade_state
%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_state
+%attr(0554,system_fw,system_fw) %{_bindir}/device_board_set_upgrade_type
+%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_type
%files auto-test
%manifest deviced.manifest
ADD_BOOT_EXECUTABLE(device_board_set_upgrade_state set-upgrade-state.c)
ADD_BOOT_EXECUTABLE(device_board_get_upgrade_state get-upgrade-state.c)
+
+ADD_BOOT_EXECUTABLE(device_board_set_upgrade_type set-upgrade-type.c)
+ADD_BOOT_EXECUTABLE(device_board_get_upgrade_type get-upgrade-type.c)
--- /dev/null
+/*
+ * device-board-get-upgrade-state
+ *
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <hal/device/hal-board.h>
+
+#define BUFFER_LEN 1024
+
+int main(int argc, char *argv[])
+{
+ char state_buffer[BUFFER_LEN];
+ int ret;
+
+ ret = hal_device_board_get_upgrade_type(state_buffer, BUFFER_LEN);
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%s\n", state_buffer);
+ return 0;
+}
--- /dev/null
+/*
+ * device-board-set-upgrade-state
+ *
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <hal/device/hal-board.h>
+
+#define UPGRADE_TYPE_ONLINE "online"
+#define UPGRADE_TYPE_OFFLINE "offline"
+
+int main(int argc, char *argv[])
+{
+ char *type = NULL;
+ int ret = 0;
+
+ if(argc < 2)
+ goto error;
+
+ type = argv[1];
+ if (strcmp(type, UPGRADE_TYPE_ONLINE) != 0 &&
+ strcmp(type, UPGRADE_TYPE_OFFLINE) != 0) {
+ goto error;
+ }
+
+ ret = hal_device_board_set_upgrade_type(type);
+ if(ret < 0)
+ goto error;
+
+ printf("SUCCESS\n");
+ return 0;
+
+error:
+ printf("FAILURE\n");
+ return 1;
+}