- // Chinese USB/HID relay command line tool:
-// Command line tool for Chinese USB/HID relays
++// Command line tool for low-cost USB/HID relays
//
- // pa02 20-Nov-2014 supports 1,2,4 - relay devices
+ // pa02 20-Nov-2014 supports 1,2,4,8 - relay devices
//
- // Build for Windows: using VC++ 2008 and WDK7.1
- //~~~~~~~~~~~~~~~~~~~~~~~~
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* Prototype: V-USB example: vusb-20121206/examples/hid-data/commandline/hidtool.c
* Author: Christian Starkjohann
}
if ( strncasecmp(arg1, "id=", 3) == 0 ) {
- if (strlen(&arg1[3]) != 5) {
- fprintf(stderr, "ERROR: ID must be 5 characters (%s)\n", arg1);
+ /* Set the ID for following commands. else use 1st found device.*/
+ if (strlen(&arg1[3]) != USB_RELAY_ID_STR_LEN) {
+ printerr("ERROR: ID must be %d characters (%s)\n", USB_RELAY_ID_STR_LEN, arg1);
return 1;
}
return err;
}
--/* ------------------------------------------------------------------------- */