4 #include "ui/common/discover-client.h"
6 static int print_device_add(struct device *device)
8 struct boot_option *opt;
10 printf("new device:\n");
11 printf("\tid: %s\n", device->id);
12 printf("\tname: %s\n", device->name);
13 printf("\tdesc: %s\n", device->description);
14 printf("\ticon: %s\n", device->icon_file);
16 printf("\tboot options:\n");
17 list_for_each_entry(&device->boot_options, opt, list) {
18 printf("\t\tid: %s\n", opt->id);
19 printf("\t\tname: %s\n", opt->name);
20 printf("\t\tdesc: %s\n", opt->description);
21 printf("\t\ticon: %s\n", opt->icon_file);
22 printf("\t\tboot: %s\n", opt->boot_image_file);
23 printf("\t\tinit: %s\n", opt->initrd_file);
24 printf("\t\targs: %s\n", opt->boot_args);
30 static void print_device_remove(char *dev_id)
32 printf("removed device:\n");
33 printf("\tid: %s\n", dev_id);
36 struct discover_client_ops client_ops = {
37 .add_device = print_device_add,
38 .remove_device = print_device_remove,
43 struct discover_client *client;
45 client = discover_client_init(&client_ops);
52 rc = discover_client_process(client);