diff autocal/txchkmain.c @ 54:21f6dba5c4df

fc-rfcal-txcheck ready to test
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 16:03:40 +0000
parents bc2397f62bdb
children b313884c79fd
line wrap: on
line diff
--- a/autocal/txchkmain.c	Sat May 27 15:41:54 2017 +0000
+++ b/autocal/txchkmain.c	Sat May 27 16:03:40 2017 +0000
@@ -6,10 +6,13 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <unistd.h>
 #include <rvinterf/l1tm.h>
 #include <rvinterf/exitcodes.h>
 #include "stdband.h"
 
+extern double tx_power_meas();
+
 static struct band {
 	char		*name;
 	unsigned	rfpw_std_band;
@@ -66,6 +69,9 @@
 main(argc, argv)
 	char **argv;
 {
+	unsigned plnum;
+	double meas;
+
 	socket_pathname_options(argc, argv);
 	finish_cmdline(argc, argv);
 	connect_rvinterf_socket();
@@ -76,6 +82,20 @@
 	printf("Putting the DUT into Test Mode\n");
 	do_tms(1);
 	do_rfpw(STD_BAND_FLAG, selected_band->rfpw_std_band);
-
+	do_rfpw(TCH_ARFCN, arfcn);
+	do_rfpw(AFC_ENA_FLAG, 0);
+	printf("Starting RF Tx on the DUT\n");
+	do_rfe(RX_TX_TCH);
 
+	for (plnum = selected_band->start_plnum;
+	     plnum <= selected_band->end_plnum; plnum++) {
+		do_txpw(TX_PWR_LEVEL, plnum);
+		usleep(20000);
+		meas = tx_power_meas();
+		printf("Tx power level #%u: %.2f dBm\n", plnum, meas);
+	}
+
+	printf("Stopping RF Tx on the DUT\n");
+	do_rfe(STOP_ALL);
+	exit(0);
 }