changeset 902:4423039aeb4b

rvtdump: report ext LCD output packets sanely
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sun, 06 Sep 2015 07:27:57 +0000
parents bacf366e8ce3
children 312778104f54
files rvinterf/lowlevel/format.c rvinterf/lowlevel/rvifmain.c rvinterf/lowlevel/rvtdump.c
diffstat 3 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/lowlevel/format.c	Sun Jul 05 03:17:40 2015 +0000
+++ b/rvinterf/lowlevel/format.c	Sun Sep 06 07:27:57 2015 +0000
@@ -179,6 +179,14 @@
 }
 
 void
+report_extui_packet()
+{
+	sprintf(fmtbuf, "LCD OUT: row %u col %u-%u", rxpkt[1], rxpkt[2],
+		rxpkt[2] + (rxpkt_len - 3) / 2 - 1);
+	output_line(fmtbuf);
+}
+
+void
 print_unknown_packet()
 {
 	int i;
--- a/rvinterf/lowlevel/rvifmain.c	Sun Jul 05 03:17:40 2015 +0000
+++ b/rvinterf/lowlevel/rvifmain.c	Sun Sep 06 07:27:57 2015 +0000
@@ -180,8 +180,10 @@
 			forward_nonrvt_pkt();
 		return;
 	case RVT_EXTUI_HEADER:
+		if (rxpkt_len < 5 || !(rxpkt_len & 1))
+			goto unknown;
 		if (!no_output || logF)
-			print_unknown_packet();	/* formatting TBD */
+			report_extui_packet();
 		if (client_head)
 			forward_nonrvt_pkt();
 		return;
--- a/rvinterf/lowlevel/rvtdump.c	Sun Jul 05 03:17:40 2015 +0000
+++ b/rvinterf/lowlevel/rvtdump.c	Sun Sep 06 07:27:57 2015 +0000
@@ -120,6 +120,11 @@
 	case RVT_AT_HEADER:
 		print_ati_output();
 		return;
+	case RVT_EXTUI_HEADER:
+		if (rxpkt_len < 5 || !(rxpkt_len & 1))
+			goto unknown;
+		report_extui_packet();
+		return;
 	case '*':
 		print_fc_lld_msg();
 		return;