| 62 | } |
| 63 | |
| 64 | static void print_help() |
| 65 | { |
| 66 | printf("HeadsetControl Developer menu. Take caution.\n\n"); |
| 67 | |
| 68 | printf("Usage\n"); |
| 69 | printf(" headsetcontrol --dev -- PARAMETERS\n"); |
| 70 | printf("\n"); |
| 71 | |
| 72 | printf("Parameters\n"); |
| 73 | printf(" --list\n" |
| 74 | "\tLists all HID devices when used without --device\n" |
| 75 | "\tWhen used with --device, searches for a specific device, and prints all interfaces and usageids\n"); |
| 76 | printf(" --device VENDORID:PRODUCTID\n" |
| 77 | "\te.g. --device 1234:5678 or --device 0x4D2:0x162E\n" |
| 78 | "\tRequired for most parameters\n"); |
| 79 | printf(" --interface INTERFACEID\n" |
| 80 | "\tWhich interface of the device to use. 0 is default\n"); |
| 81 | printf(" --usage USAGEPAGE:USAGEID\n" |
| 82 | "\tSpecifies an usage-page and usageid. 0:0 is default\n" |
| 83 | "\tImportant for Windows. Ignored on Mac/Linux\n"); |
| 84 | printf("\n"); |
| 85 | |
| 86 | printf(" --send DATA\n" |
| 87 | "\tSend data to specified device\n"); |
| 88 | printf(" --send-feature DATA\n" |
| 89 | "\tSend a feature report to the device. The first byte is the reportid\n"); |
| 90 | printf(" --sleep microsecounds\n" |
| 91 | "\tSleep for x microsecounds after sending\n"); |
| 92 | printf(" --receive\n" |
| 93 | "\tTry to receive data from device. Can be combined with --timeout\n"); |
| 94 | printf(" --timeout\n" |
| 95 | "\t--timeout in millisecounds for --receive\n"); |
| 96 | printf(" --receive-feature REPORTID\n" |
| 97 | "\tTry to receive a report for REPORTID.\n"); |
| 98 | printf(" --repeat SECS\n" |
| 99 | "\tRepeat command every SECS.\n"); |
| 100 | printf("\n"); |
| 101 | |
| 102 | printf(" --dev-help\n" |
| 103 | "\tThis menu\n"); |
| 104 | printf("\n"); |
| 105 | |
| 106 | printf("HINTS\n"); |
| 107 | printf("\tsend and receive can be combined\n"); |
| 108 | printf("\t--send does not return anything on success and is always executed first\n"); |
| 109 | printf("\tDATA can be specified as single bytes, either as decimal or hex, separated by spaces or commas or newlines\n"); |
| 110 | printf("\n"); |
| 111 | |
| 112 | printf("EXAMPLEs\n"); |
| 113 | printf(" headsetcontrol --dev -- --list\n"); |
| 114 | printf(" headsetcontrol --dev -- --list --device 0x1b1c:0x1b27\n"); |
| 115 | printf(" headsetcontrol --dev -- --device 0x1b1c:0x1b27 --send \"0xC9, 0x64\" --receive --timeout 10\n"); |
| 116 | } |
| 117 | |
| 118 | int dev_main(int argc, char* argv[]) |
| 119 | { |