aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2019-01-29 16:22:33 (GMT)
committerSean Young <sean@mess.org>2019-01-30 09:45:04 (GMT)
commit2b3b518a68f77feb809ca383bb20bb66f6e08b36 (patch)
treebf2b4c52273f6556022cd55d7bfb92ce42c550de
parent704281dae2605d263f3197dc862d103e6150dcf9 (diff)
ir-ctl: Print receiver timeout
Signed-off-by: Sean Young <sean@mess.org>
-rw-r--r--utils/ir-ctl/ir-ctl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 7ecb131..f8f4e0a 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -708,8 +708,13 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
if (features & LIRC_CAN_MEASURE_CARRIER)
printf(_(" - Can measure carrier\n"));
if (features & LIRC_CAN_SET_REC_TIMEOUT) {
- unsigned min_timeout, max_timeout;
- int rc = ioctl(fd, LIRC_GET_MIN_TIMEOUT, &min_timeout);
+ unsigned min_timeout, max_timeout, timeout;
+
+ // This ioctl is only supported from kernel 4.18 onwards
+ int rc = ioctl(fd, LIRC_GET_REC_TIMEOUT, &timeout);
+ if (rc == 0)
+ printf(_(" - Receiving timeout %u microseconds\n"), timeout);
+ rc = ioctl(fd, LIRC_GET_MIN_TIMEOUT, &min_timeout);
if (rc) {
fprintf(stderr, _("warning: %s: device supports setting receiving timeout but LIRC_GET_MIN_TIMEOUT returns: %m\n"), dev);
min_timeout = 0;
@@ -724,7 +729,7 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
}
if (min_timeout || max_timeout)
- printf(_(" - Can set receiving timeout min:%u microseconds max:%u microseconds\n"), min_timeout, max_timeout);
+ printf(_(" - Can set receiving timeout min %u microseconds, max %u microseconds\n"), min_timeout, max_timeout);
}
} else if (features & LIRC_CAN_REC_LIRCCODE) {
printf(_(" - Device can receive using device dependent LIRCCODE mode (not supported)\n"));

Privacy Policy