diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-09-04 22:52:15 +0100 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-09-04 22:52:15 +0100 |
| commit | d0f299bc02fd41b1b30843f4ac8ff2c198ae741e (patch) | |
| tree | b4ad91b12abced1b9e89566d09f44472204f4214 /ScanHID.c | |
| parent | 78f78927abe92a2c305117faa16b3e336f94f207 (diff) | |
| parent | 7c796758d1b65d4d7585c90ba71b1fb339a4d283 (diff) | |
Update upstream source from tag 'upstream/6.0.25.1+repack'
Update to upstream version '6.0.25.1+repack'
with Debian dir 5c600492d37f157e53545494f5a022c05441e400
Diffstat (limited to 'ScanHID.c')
| -rw-r--r-- | ScanHID.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ScanHID.c b/ScanHID.c new file mode 100644 index 0000000..4d48d87 --- /dev/null +++ b/ScanHID.c @@ -0,0 +1,51 @@ +// ScanHID.cpp : Defines the entry point for the console application.
+//
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include <stdio.h>
+#include <conio.h>
+#include <stdlib.h>
+
+#include "hidapi.h"
+
+int main(int argc, char* argv[])
+{
+ char product[256];
+ char sernum[256] = "NULL";
+
+ struct hid_device_info *devs, *cur_dev;
+ const char *path_to_open = NULL;
+ hid_device *handle = NULL;
+
+ // Look for Device
+
+ devs = hid_enumerate(0,0); // so we list devices(USHORT)VID, (USHORT)PID);
+ cur_dev = devs;
+ while (cur_dev)
+ {
+ wcstombs(product, cur_dev->product_string, 255);
+ if (cur_dev->serial_number)
+ wcstombs(sernum, cur_dev->serial_number, 255);
+
+ if (product)
+ printf("HID Device %s VID %X PID %X Ser %s\r\n Path %s\r\n\r\n", product, cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
+ else
+ printf("HID Device %s VID %X PID %X Ser %s\r\n Path %s\r\n\r\n", "Missing Product", cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
+
+
+ cur_dev = cur_dev->next;
+ }
+
+
+ hid_free_enumeration(devs);
+ printf("Press any key to Exit");
+ _getch();
+
+
+}
+
+
+
+
|
