diff --git a/extras/rawhid/Makefile b/extras/rawhid/Makefile index 62d2d66..c09ecdc 100644 --- a/extras/rawhid/Makefile +++ b/extras/rawhid/Makefile @@ -7,7 +7,7 @@ PROG = rawhid_test # To set up Ubuntu Linux to cross compile for Windows: # -# apt-get install mingw32 mingw32-binutils mingw32-runtime +# apt-get install mingw32 mingw32-binutils mingw32-runtime libusb-dev # # Just edit the variable above for WINDOWS, then use "make" to build rawhid.exe diff --git a/extras/rawhid/rawhid_test.c b/extras/rawhid/rawhid_test.c index 7bea892..fc07260 100644 --- a/extras/rawhid/rawhid_test.c +++ b/extras/rawhid/rawhid_test.c @@ -18,13 +18,14 @@ static char get_keystroke(void); int main() { int i, r, num; - char c, buf[64]; + char c, buf[200]; // C-based example is 16C0:0480:FFAB:0200 r = rawhid_open(1, 0x16C0, 0x0480, 0xFFAB, 0x0200); if (r <= 0) { - // Arduino-based example is 16C0:0486:FFAB:0200 - r = rawhid_open(1, 0x16C0, 0x0486, 0xFFAB, 0x0200); + // Arduino-based example is 0x2341:XXXX:FFC0:0C00 + // To keep compatible with other vendors we only use the raw HID number + r = rawhid_open(1, -1, -1, 0xFFC0, 0x0C00); if (r <= 0) { printf("no rawhid device found\n"); return -1; @@ -52,10 +53,10 @@ int main() while ((c = get_keystroke()) >= 32) { printf("\ngot key '%c', sending...\n", c); buf[0] = c; - for (i=1; i<64; i++) { - buf[i] = 0; + for (i=1; i