MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / parse_hid_vid_pid_from_sysfs

Function parse_hid_vid_pid_from_sysfs

lib/hidapi/linux/hid.c:470–482  ·  view source on GitHub ↗

return non-zero if successfully read/parsed */

Source from the content-addressed store, hash-verified

468
469/* return non-zero if successfully read/parsed */
470static int parse_hid_vid_pid_from_sysfs(const char *sysfs_path, unsigned *bus_type, unsigned short *vendor_id, unsigned short *product_id)
471{
472 int res = 0;
473 /* Construct <sysfs_path>/device/uevent */
474 size_t uevent_path_len = strlen(sysfs_path) + 14 + 1;
475 char* uevent_path = (char*) calloc(1, uevent_path_len);
476 snprintf(uevent_path, uevent_path_len, "%s/device/uevent", sysfs_path);
477
478 res = parse_hid_vid_pid_from_uevent_path(uevent_path, bus_type, vendor_id, product_id);
479 free(uevent_path);
480
481 return res;
482}
483
484static int get_hid_report_descriptor_from_hidraw(hid_device *dev, struct hidraw_report_descriptor *rpt_desc)
485{

Callers 1

hid_enumerateFunction · 0.85

Calls 1

Tested by

no test coverage detected