changeset 136:da4d4af80fdd

fc-tmsh: ttw response handling implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 20 Feb 2017 02:25:53 +0000
parents 40807eb35ffe
children 79e71354ba7b
files rvinterf/tmsh/etmbasic.c rvinterf/tmsh/l1resp.c
diffstat 2 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/etmbasic.c	Mon Feb 20 02:04:27 2017 +0000
+++ b/rvinterf/tmsh/etmbasic.c	Mon Feb 20 02:25:53 2017 +0000
@@ -137,7 +137,9 @@
 		l1tm_response_index_val("txpr");
 		return;
 	case TX_TEMPLATE_WRITE:
-		print_etm_pkt_raw("TX_TEMPLATE_WRITE response");
+		if (rvi_msg_len < 5)
+			goto runt;
+		l1tm_ttw_response();
 		return;
 	case TX_TEMPLATE_READ:
 		print_etm_pkt_raw("TX_TEMPLATE_READ response");
--- a/rvinterf/tmsh/l1resp.c	Mon Feb 20 02:04:27 2017 +0000
+++ b/rvinterf/tmsh/l1resp.c	Mon Feb 20 02:25:53 2017 +0000
@@ -307,3 +307,24 @@
 		async_msg_output(buf);
 	}
 }
+
+void
+l1tm_ttw_response()
+{
+	char buf[80];
+
+	if (rvi_msg[3]) {
+		if (rvi_msg_len == 5) {
+			sprintf(buf, "ttw error %u (0x%02X)",
+				rvi_msg[3], rvi_msg[3]);
+			async_msg_output(buf);
+		} else
+			print_etm_pkt_raw("ttw long error response");
+		return;
+	}
+	if (rvi_msg_len < 5 || rvi_msg_len > 6) {
+		print_etm_pkt_raw("ttw response wrong length");
+		return;
+	}
+	async_msg_output("ttw OK");
+}