changeset 69:4e263849b064

fc-cmu200d: CMU200 external attenuation setting implemented in signal gen mode
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 14 Jul 2017 04:52:03 +0000
parents 3ec82dc1dbda
children e35da125c937
files cmu200/signalgen.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmu200/signalgen.c	Fri Jul 14 04:34:15 2017 +0000
+++ b/cmu200/signalgen.c	Fri Jul 14 04:52:03 2017 +0000
@@ -7,6 +7,7 @@
 #include <string.h>
 #include <strings.h>
 #include "mode.h"
+#include "band.h"
 #include "secaddr.h"
 
 extern char *cmu200_tx_name;
@@ -16,6 +17,7 @@
 extern int client_cmd_nfields;
 
 extern int current_mode;
+extern struct band *current_band;
 
 stop_signal_gen()
 {
@@ -30,7 +32,7 @@
 cmd_signal_gen_setup()
 {
 	int rc;
-	char cmdstr[32];
+	char cmdstr[80];
 
 	if (client_cmd_nfields != 2) {
 		send_socket_response("-Wrong number of arguments\n");
@@ -47,6 +49,10 @@
 	send_scpi_cmd(cmdstr);
 	sprintf(cmdstr, "OUTP:%s RF%d\n", cmu200_tx_name, cmu200_rf_port);
 	send_scpi_cmd(cmdstr);
+	sprintf(cmdstr, "CORR:LOSS:OUTP%d:%s %u.%u\n", cmu200_rf_port,
+		cmu200_tx_name, current_band->dl_cable_loss / 10,
+		current_band->dl_cable_loss % 10);
+	send_scpi_cmd(cmdstr);
 	current_mode = OP_MODE_SIGNAL_GEN;
 	send_socket_response("+OK\n");
 	return(0);