diff mbox series

[v4l-utils] ir-ctl: report ir overflow

Message ID 20220128153227.448827-1-sean@mess.org (mailing list archive)
State New, archived
Headers show
Series [v4l-utils] ir-ctl: report ir overflow | expand

Commit Message

Sean Young Jan. 28, 2022, 3:32 p.m. UTC
Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-ctl.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 27c309f9..240a3752 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -1197,13 +1197,18 @@  int lirc_receive(struct arguments *args, int fd, unsigned features)
 				case LIRC_MODE2_FREQUENCY:
 					fprintf(out, "carrier %u\n", val);
 					break;
+				case LIRC_MODE2_OVERFLOW:
+					fprintf(out, "overflow\n");
+					leading_space = true;
+					break;
 				}
 			} else {
 				switch (msg) {
 				case LIRC_MODE2_TIMEOUT:
-					fprintf(out, "-%u\n", val);
 					if (carrier)
-						fprintf(out, " # carrier %uHz, timeout %u\n", carrier, val);
+						fprintf(out, "-%u # carrier %uHz\n", val, carrier);
+					else
+						fprintf(out, "-%u\n", val);
 					leading_space = true;
 					carrier = 0;
 					break;
@@ -1216,6 +1221,14 @@  int lirc_receive(struct arguments *args, int fd, unsigned features)
 				case LIRC_MODE2_FREQUENCY:
 					carrier = val;
 					break;
+				case LIRC_MODE2_OVERFLOW:
+					if (carrier)
+						fprintf(out, "# carrier %uHz, overflow\n", carrier);
+					else
+						fprintf(out, "# overflow\n");
+					leading_space = true;
+					carrier = 0;
+					break;
 				}
 			}