*
*/
+#include <stdio.h>
#include <hal/device/hal-board.h>
int main(int argc, char *argv[])
{
- return hal_device_board_clear_boot_mode();
+ int ret = hal_device_board_clear_boot_mode();
+
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
}
*
*/
+#include <stdio.h>
#include <hal/device/hal-board.h>
int main(int argc, char *argv[])
{
- return hal_device_board_clear_partition_ab_cloned();
+ int ret = hal_device_board_clear_partition_ab_cloned();
+
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
}
int ret;
ret = hal_device_board_get_boot_mode(buffer, sizeof(buffer));
- if (ret == 0)
- printf("%s", buffer);
- return ret;
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%s\n", buffer);
+ return 0;
}
int ret;
ret = hal_device_board_get_partition_ab_cloned(&cloned);
- if (ret == 0)
- printf("%d", cloned);
- return ret;
+ if (ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%d\n", cloned);
+ return 0;
}
int ret;
ret = hal_device_board_get_upgrade_status(&status);
- if (ret == 0)
- printf("%d", status);
- return ret;
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%d\n", status);
+ return 0;
}
*
*/
+#include <stdio.h>
#include <hal/device/hal-board.h>
int main(int argc, char *argv[])
{
- return hal_device_board_set_boot_success();
+ int ret = hal_device_board_set_boot_success();
+
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
}
*
*/
+#include <stdio.h>
#include <hal/device/hal-board.h>
int main(int argc, char *argv[])
{
- return hal_device_board_set_partition_ab_cloned();
+ int ret = hal_device_board_set_partition_ab_cloned();
+
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
}
int main(int argc, char *argv[])
{
int status;
- int parse_ret;
+ int parse_ret, ret;
if(argc < 2) {
- return -EINVAL;
+ goto err;
}
parse_ret = parse_integer(argv[1], &status);
- if(parse_ret != 0) {
- return -EINVAL;
+ if(parse_ret < 0) {
+ goto err;
}
- return hal_device_board_set_upgrade_status(status);
+ ret = hal_device_board_set_upgrade_status(status);
+
+ if(ret < 0) {
+ goto err;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
+
+err:
+ printf("FAILURE\n");
+ return 1;
}
*
*/
+#include <stdio.h>
#include <errno.h>
#include <hal/device/hal-board.h>
int main(int argc, char *argv[])
{
char partition_ab;
+ int ret;
if(argc < 2) {
- return -EINVAL;
+ goto err;
}
partition_ab = argv[1][0];
if(partition_ab != 'a' && partition_ab != 'b') {
- return -EINVAL;
+ goto err;
}
- return hal_device_board_switch_partition(partition_ab);
+ ret = hal_device_board_switch_partition(partition_ab);
+
+ if(ret < 0) {
+ goto err;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
+
+err:
+ printf("FAILURE\n");
+ return 1;
}