changeset 151:74b9aeb25d79

fc-tmsh: oabbr and oabbw response handling implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 05 Mar 2017 09:18:22 +0000
parents 45d8c175f9b5
children 9a08c09a07c0
files rvinterf/tmsh/abbtm3.c rvinterf/tmsh/etmbasic.c
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/abbtm3.c	Sun Mar 05 09:07:01 2017 +0000
+++ b/rvinterf/tmsh/abbtm3.c	Sun Mar 05 09:18:22 2017 +0000
@@ -16,6 +16,30 @@
 extern u_char rvi_msg[];
 extern int rvi_msg_len;
 
+void
+handle_oabbr_response()
+{
+	char buf[80];
+	unsigned val;
+
+	if (rvi_msg[3]) {
+		if (rvi_msg_len == 5) {
+			sprintf(buf, "oabbr error %u (0x%02X)",
+				rvi_msg[3], rvi_msg[3]);
+			async_msg_output(buf);
+		} else
+			print_etm_pkt_raw("oabbr long error response");
+		return;
+	}
+	if (rvi_msg_len != 7) {
+		print_etm_pkt_raw("oabbr response wrong length");
+		return;
+	}
+	val = rvi_msg[4] | (rvi_msg[5] << 8);
+	sprintf(buf, "oabbr: %04X", val);
+	async_msg_output(buf);
+}
+
 cmd_oabbr(argc, argv)
 	char **argv;
 {
--- a/rvinterf/tmsh/etmbasic.c	Sun Mar 05 09:07:01 2017 +0000
+++ b/rvinterf/tmsh/etmbasic.c	Sun Mar 05 09:18:22 2017 +0000
@@ -71,6 +71,14 @@
 	case MEM_WRITE:
 		l1tm_response_nodata("omw");
 		return;
+	case CODEC_READ:
+		if (rvi_msg_len < 5)
+			goto runt;
+		handle_oabbr_response();
+		return;
+	case CODEC_WRITE:
+		l1tm_response_nodata("oabbw");
+		return;
 	/* L1TM */
 	case TM_INIT:
 		l1tm_response_nodata("tminit");