diff options
author | Andrew Duggan <aduggan@synaptics.com> | 2016-02-23 10:09:26 -0800 |
---|---|---|
committer | Andrew Duggan <aduggan@synaptics.com> | 2016-02-23 10:09:26 -0800 |
commit | 93de3d6514bcec9c5d8ceb4454c429e4ef9da545 (patch) | |
tree | e60738f757872e4997144015070392288dfedb80 /rmihidtool | |
parent | 8900caa5c44f9ccaf634d4624f0c5265c732498a (diff) | |
download | rmi4utils-93de3d6514bcec9c5d8ceb4454c429e4ef9da545.tar.gz |
rmidevice / rmihidtool: Add feature to print config id
Based on changes from Leon Tu.
Diffstat (limited to 'rmihidtool')
-rw-r--r-- | rmihidtool/main.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/rmihidtool/main.cpp b/rmihidtool/main.cpp index 0fc2b1a..540b5a7 100644 --- a/rmihidtool/main.cpp +++ b/rmihidtool/main.cpp @@ -34,13 +34,14 @@ #include "hiddevice.h" -#define RMI4UPDATE_GETOPTS "hp:ir:w:foambde" +#define RMI4UPDATE_GETOPTS "hp:ir:w:foambdec" enum rmihidtool_cmd { RMIHIDTOOL_CMD_INTERACTIVE, RMIHIDTOOL_CMD_READ, RMIHIDTOOL_CMD_WRITE, RMIHIDTOOL_CMD_FW_ID, + RMIHIDTOOL_CMD_CF_ID, RMIHIDTOOL_CMD_PROPS, RMIHIDTOOL_CMD_ATTN, RMIHIDTOOL_CMD_PRINT_FUNCTIONS, @@ -61,6 +62,7 @@ void print_help(const char *prog_name) fprintf(stdout, "\t-r, --read [address] [length]\t\tRead registers starting at the address.\n"); fprintf(stdout, "\t-r, --write [address] [length] [data]\tWrite registers starting at the address.\n"); fprintf(stdout, "\t-f, --firmware-id\t\t\tPrint the firmware id\n"); + fprintf(stdout, "\t-c, --config-id\t\t\t\tPrint the config id\n"); fprintf(stdout, "\t-o, --props\t\t\t\tPrint device properties\n"); fprintf(stdout, "\t-a, --attention\t\t\t\tPrint attention reports until control + c\n"); fprintf(stdout, "\t-m, --print-functions\t\t\tPrint RMI4 functions for the device.\n"); @@ -212,6 +214,7 @@ int main(int argc, char ** argv) {"read", 1, NULL, 'r'}, {"write", 1, NULL, 'w'}, {"firmware-id", 0, NULL, 'f'}, + {"config-id", 0, NULL, 'c'}, {"props", 0, NULL, 'o'}, {"attention", 0, NULL, 'a'}, {"print-functions", 0, NULL, 'm'}, @@ -257,6 +260,9 @@ int main(int argc, char ** argv) case 'f': cmd = RMIHIDTOOL_CMD_FW_ID; break; + case 'c': + cmd = RMIHIDTOOL_CMD_CF_ID; + break; case 'o': cmd = RMIHIDTOOL_CMD_PROPS; break; @@ -333,6 +339,11 @@ int main(int argc, char ** argv) device->QueryBasicProperties(); fprintf(stdout, "firmware id: %lu\n", device->GetFirmwareID()); break; + case RMIHIDTOOL_CMD_CF_ID: + device->ScanPDT(); + device->QueryBasicProperties(); + fprintf(stdout, "config id: %08lx\n", device->GetConfigID()); + break; case RMIHIDTOOL_CMD_PROPS: device->ScanPDT(); device->QueryBasicProperties(); |