#include "ui/common/discover-client.h"
+static const char *device_type_string(enum device_type type)
+{
+ switch (type) {
+ case DEVICE_TYPE_DISK:
+ return "disk";
+ case DEVICE_TYPE_NETWORK:
+ return "network";
+ case DEVICE_TYPE_OPTICAL:
+ return "optical";
+ case DEVICE_TYPE_UNKNOWN:
+ return "unknown";
+ }
+ return "invalid";
+}
+
static int print_device_add(struct device *device,
void __attribute__((unused)) *arg)
{
printf("new device:\n");
printf("\tid: %s\n", device->id);
+ printf("\ttype: %s\n", device_type_string(device->type));
printf("\tname: %s\n", device->name);
printf("\tdesc: %s\n", device->description);
printf("\ticon: %s\n", device->icon_file);
printf("\t\ticon: %s\n", opt->icon_file);
printf("\t\tboot: %s\n", opt->boot_image_file);
printf("\t\tinit: %s\n", opt->initrd_file);
+ printf("\t\tdtb: %s\n", opt->dtb_file);
printf("\t\targs: %s\n", opt->boot_args);
}
printf("\tboot: %s\n", opt->boot_image_file);
printf("\tinit: %s\n", opt->initrd_file);
printf("\targs: %s\n", opt->boot_args);
+ printf("\tdefault:%d\n", opt->is_default);
return 0;
}
printf("\tname: %s\n", device->name);
}
+static void print_status(struct boot_status *status,
+ void __attribute__((unused)) *arg)
+{
+ printf("status:\n");
+ printf("\ttype: %d\n", status->type);
+ printf("\tmessage: %s\n", status->message);
+ printf("\tdetail: %s\n", status->detail);
+ printf("\tprogress: %d\n", status->progress);
+
+}
+
static struct discover_client_ops client_ops = {
.device_add = print_device_add,
.boot_option_add = print_boot_option_add,
.device_remove = print_device_remove,
+ .update_status = print_status,
};
int main(void)