This is an example of using RPC bus API to enumerate librpc-capable USB devices in the system.
#include <stdio.h>
#include <errno.h>
#include <string.h>
int
main(int argc, const char *argv[])
{
int n, i;
int ret;
(void)argc;
(void)argv;
if (n < 0) {
fprintf(stderr, "rpc_bus_enumerate: %s\n", strerror(errno));
return (1);
}
for (i = 0; i < n; i++) {
switch (ret) {
case 1:
printf(" responds to ping\n");
break;
default:
printf(" failed to ping, error %d [%s]\n", errno,
strerror(errno));
break;
}
}
return (0);
}