diff autocal/rxcommon.c @ 46:751f8d9efed0

Rx cal: started the single measurement code
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 06:25:59 +0000
parents 98abe6bd2042
children 1a0dbc746d57
line wrap: on
line diff
--- a/autocal/rxcommon.c	Sat May 27 05:48:04 2017 +0000
+++ b/autocal/rxcommon.c	Sat May 27 06:25:59 2017 +0000
@@ -21,3 +21,34 @@
 	do_scw(STAT_BITMASK, DSP_PM);
 	return(0);
 }
+
+halfdb_to_string(halfdb, strbuf)
+	int halfdb;
+	char *strbuf;
+{
+	int sign;
+
+	if (halfdb < 0) {
+		sign = 1;
+		halfdb = -halfdb;
+	} else
+		sign = 0;
+	sprintf(strbuf, "%s%d.%c", sign ? "-" : "", halfdb >> 1,
+		halfdb & 1 ? '5' : '0');
+	return(0);
+}
+
+rx_single_offset_meas(arfcn, offset)
+	unsigned arfcn;
+	char *offset;
+{
+	char dbm[64], tsid_cmd[128];
+
+	halfdb_to_string(RXCAL_SIGGEN_LEVEL, dbm);
+	printf("Rx meas at ARFCN %u offset %s kHz, TL=%s dBm, AGC=%d dB\n",
+		arfcn, offset, dbm, RXCAL_AGC_DB);
+	sprintf(tsid_cmd, "signal-gen-sine %u %s %s\n", arfcn, offset, dbm);
+	tsid_command(tsid_cmd);
+
+
+}