4 #include "ui/common/discover-client.h"
5 #include "ui/common/device.h"
7 static int print_device_add(struct device *device)
11 printf("new device:\n");
12 printf("\tid: %s\n", device->id);
13 printf("\tname: %s\n", device->name);
14 printf("\tdesc: %s\n", device->description);
15 printf("\ticon: %s\n", device->icon_file);
17 printf("\t%d boot options:\n", device->n_options);
18 for (i = 0; i < device->n_options; i++) {
19 struct boot_option *opt = &device->options[i];
20 printf("\t\tid: %s\n", opt->id);
21 printf("\t\tname: %s\n", opt->name);
22 printf("\t\tdesc: %s\n", opt->description);
23 printf("\t\ticon: %s\n", opt->icon_file);
24 printf("\t\tboot: %s\n", opt->boot_image_file);
25 printf("\t\tinit: %s\n", opt->initrd_file);
26 printf("\t\targs: %s\n", opt->boot_args);
32 static void print_device_remove(const char *dev_id)
34 printf("removed device:\n");
35 printf("\tid: %s\n", dev_id);
38 struct discover_client_ops client_ops = {
39 .add_device = print_device_add,
40 .remove_device = print_device_remove,
45 struct discover_client *client;
47 client = discover_client_init(&client_ops);
54 rc = discover_client_process(client);