]>
git.ipfire.org Git - thirdparty/systemd.git/blob - man/hwdb-usb-device.c
1 /* SPDX-License-Identifier: MIT-0 */
6 #include <systemd/sd-hwdb.h>
8 int print_usb_properties(uint16_t vid
, uint16_t pid
) {
11 const char *key
, *value
;
14 /* Match this USB vendor and product ID combination */
15 snprintf(match
, sizeof match
, "usb:v%04Xp%04X", vid
, pid
);
17 r
= sd_hwdb_new(&hwdb
);
21 SD_HWDB_FOREACH_PROPERTY(hwdb
, match
, key
, value
)
22 printf("%s: \"%s\" → \"%s\"\n", match
, key
, value
);
28 int main(int argc
, char **argv
) {
29 print_usb_properties(0x046D, 0xC534);