changeset 59:c87067884da7

autocal/l1tmops.c: do_rftr() added
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 23:23:35 +0000
parents 46c72323182a
children 81e8f7e99d89
files autocal/l1tmops.c
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/autocal/l1tmops.c	Sat May 27 23:17:14 2017 +0000
+++ b/autocal/l1tmops.c	Sat May 27 23:23:35 2017 +0000
@@ -197,6 +197,31 @@
 	return(0);
 }
 
+do_rftr(index, table, size)
+	u_char *table;
+{
+	u_char cmdpkt[4];
+
+	cmdpkt[1] = RF_TABLE_READ;
+	cmdpkt[2] = index;
+	l1tm_pkt_exch(cmdpkt, 2);
+	if (rvi_msg[3]) {
+		fprintf(stderr, "DUT error %u in response to rftr\n",
+			rvi_msg[3]);
+		exit(ERROR_TARGET);
+	}
+	if (rvi_msg_len != size + 6) {
+		fprintf(stderr, "DUT error: rftr response wrong length\n");
+		exit(ERROR_TARGET);
+	}
+	if (rvi_msg[4] != index) {
+		fprintf(stderr, "DUT error: rftr response wrong index\n");
+		exit(ERROR_TARGET);
+	}
+	bcopy(rvi_msg + 5, table, size);
+	return(0);
+}
+
 misc_enable(arg)
 {
 	u_char cmdpkt[5];