MCPcopy Create free account
hub / github.com/Sapd/HeadsetControl / print_devices

Function print_devices

src/dev.c:24–42  ·  view source on GitHub ↗

* @brief Print information of devices * * When vendorid and productid are 0, then all are listed. * If they are specified, information about all usagepages and interfaces of the respective device are listed * * @param vendorid * @param productid */

Source from the content-addressed store, hash-verified

22 * @param productid
23 */
24static void print_devices(unsigned short vendorid, unsigned short productid)
25{
26 struct hid_device_info *devs, *cur_dev;
27
28 devs = hid_enumerate(vendorid, productid);
29 cur_dev = devs;
30 while (cur_dev) {
31 printf("Device Found\n VendorID: %#06hx\n ProductID: %#06hx\n path: %s\n serial_number: %ls",
32 cur_dev->vendor_id, cur_dev->product_id, cur_dev->path, cur_dev->serial_number);
33 printf("\n");
34 printf(" Manufacturer: %ls\n", cur_dev->manufacturer_string);
35 printf(" Product: %ls\n", cur_dev->product_string);
36 printf(" Interface: %d\n", cur_dev->interface_number);
37 printf(" Usage-Page: 0x%hx Usageid: 0x%hx\n", cur_dev->usage_page, cur_dev->usage);
38 printf("\n");
39 cur_dev = cur_dev->next;
40 }
41 hid_free_enumeration(devs);
42}
43
44/**
45 * @brief check if number inside range

Callers 1

dev_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected