changeset 8:c873a36a16e6

fc-cmu200d: freq-meas implemented without response parsing
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 May 2017 18:20:55 +0000
parents 948031e6de50
children 6d7079a81e8b
files cmu200/dispatch.c cmu200/vcxocal.c
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cmu200/dispatch.c	Sun May 21 08:03:35 2017 +0000
+++ b/cmu200/dispatch.c	Sun May 21 18:20:55 2017 +0000
@@ -10,6 +10,7 @@
 extern char *client_cmd_fields[];
 extern int client_cmd_nfields;
 
+extern int cmd_freq_meas();
 extern int cmd_signal_gen_off();
 extern int cmd_signal_gen_sine();
 extern int cmd_signal_gen_setup();
@@ -25,6 +26,7 @@
 	char	*cmd_kw;
 	int	(*handler)();
 } cmdtab[] = {
+	{"freq-meas", cmd_freq_meas},
 	{"ping", cmd_ping},
 	{"signal-gen-off", cmd_signal_gen_off},
 	{"signal-gen-sine", cmd_signal_gen_sine},
--- a/cmu200/vcxocal.c	Sun May 21 08:03:35 2017 +0000
+++ b/cmu200/vcxocal.c	Sun May 21 18:20:55 2017 +0000
@@ -15,6 +15,8 @@
 extern int current_mode;
 extern struct band *current_band;
 
+extern char instrument_response[];
+
 cmd_vcxo_cal_setup()
 {
 	int rc;
@@ -46,3 +48,16 @@
 	send_socket_response("+OK\n");
 	return(0);
 }
+
+cmd_freq_meas()
+{
+	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");
+	return(0);
+}