1 /* SPDX-License-Identifier: MIT-0 */
5 #include <systemd/sd-hwdb.h>
7 int print_usb_properties(uint16_t vid
, uint16_t pid
) {
10 const char *key
, *value
;
13 /* Match this USB vendor and product ID combination */
14 snprintf(match
, sizeof match
, "usb:v%04Xp%04X", vid
, pid
);
16 r
= sd_hwdb_new(&hwdb
);
20 SD_HWDB_FOREACH_PROPERTY(hwdb
, match
, key
, value
)
21 printf("%s: \"%s\" → \"%s\"\n", match
, key
, value
);
27 int main(int argc
, char **argv
) {
28 print_usb_properties(0x046D, 0xC534);