diff cmu200/vcxocal.c @ 11:aeffe53e110d

fc-cmu200d: freq-meas works
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 May 2017 19:22:11 +0000
parents c873a36a16e6
children 34c6fbe38daa
line wrap: on
line diff
--- a/cmu200/vcxocal.c	Sun May 21 18:57:44 2017 +0000
+++ b/cmu200/vcxocal.c	Sun May 21 19:22:11 2017 +0000
@@ -51,13 +51,21 @@
 
 cmd_freq_meas()
 {
+	char *resp_fields[11];
+	char client_resp[128];
+
 	if (current_mode != OP_MODE_VCXO_CAL) {
 		send_socket_response("-Wrong mode\n");
 		return(0);
 	}
 	send_scpi_cmd("READ:MOD?\n");
 	collect_instr_response();
-	/* response parsing and freq offset extraction to be implemented */
-	send_socket_response("+ TBD\n");
+	if (parse_commasep_response(resp_fields, 11) < 0) {
+		send_socket_response
+			("-CMU200 response has wrong number of fields\n");
+		return(0);
+	}
+	sprintf(client_resp, "+ %s\n", resp_fields[7]);
+	send_socket_response(client_resp);
 	return(0);
 }