aboutsummaryrefslogtreecommitdiff
path: root/rmi4update/main.cpp
diff options
context:
space:
mode:
authorLeon Tu <Leon.Tu@tw.synaptics.com>2018-07-27 15:56:20 -0700
committerAndrew Duggan <aduggan@synaptics.com>2018-07-27 15:56:20 -0700
commitc0d59b49610e8b8afc40138cc2fc5b33d6e28ec9 (patch)
tree25ae9caa55ebaa3c4439013bd33143845343ae2c /rmi4update/main.cpp
parentdc1391ffd74ad9b389605eb27dcb2268a1164002 (diff)
downloadrmi4utils-c0d59b49610e8b8afc40138cc2fc5b33d6e28ec9.tar.gz
Add option to filter based on touchscreen or touchpad
Diffstat (limited to 'rmi4update/main.cpp')
-rw-r--r--rmi4update/main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/rmi4update/main.cpp b/rmi4update/main.cpp
index 8fb1677..a354475 100644
--- a/rmi4update/main.cpp
+++ b/rmi4update/main.cpp
@@ -35,7 +35,7 @@
#define VERSION_MINOR 2
#define VERSION_SUBMINOR 10
-#define RMI4UPDATE_GETOPTS "hfd:pclv"
+#define RMI4UPDATE_GETOPTS "hfdt:pclv"
void printHelp(const char *prog_name)
{
@@ -47,6 +47,7 @@ void printHelp(const char *prog_name)
fprintf(stdout, "\t-c, --config-id\tPrint the config id.\n");
fprintf(stdout, "\t-l, --lockdown\tPerform lockdown.\n");
fprintf(stdout, "\t-v, --version\tPrint version number.\n");
+ fprintf(stdout, "\t-t, --device-type\t\t\tFilter by device type [touchpad or touchscreen].\n");
}
void printVersion()
@@ -101,12 +102,14 @@ int main(int argc, char **argv)
{"config-id", 0, NULL, 'c'},
{"lockdown", 0, NULL, 'l'},
{"version", 0, NULL, 'v'},
+ {"device-type", 1, NULL, 't'},
{0, 0, 0, 0},
};
bool printFirmwareProps = false;
bool printConfigid = false;
bool performLockdown = false;
HIDDevice device;
+ enum RMIDeviceType deviceType = RMI_DEVICE_TYPE_ANY;
while ((opt = getopt_long(argc, argv, RMI4UPDATE_GETOPTS, long_options, &index)) != -1) {
switch (opt) {
@@ -129,6 +132,12 @@ int main(int argc, char **argv)
case 'l':
performLockdown = true;
break;
+ case 't':
+ if (!strcasecmp((const char *)optarg, "touchpad"))
+ deviceType = RMI_DEVICE_TYPE_TOUCHPAD;
+ else if (!strcasecmp((const char *)optarg, "touchscreen"))
+ deviceType = RMI_DEVICE_TYPE_TOUCHSCREEN;
+ break;
case 'v':
printVersion();
return 0;
@@ -174,10 +183,8 @@ int main(int argc, char **argv)
strerror(errno));
return 1;
}
- //device.SetTransportDevice(deviceName);
- //device.g_transportDeviceName = deviceName; // leon
} else {
- if (!device.FindDevice())
+ if (!device.FindDevice(deviceType))
return 1;
}