view autocal/txpwrmeas.c @ 132:94e8a410d6bd

fc-rfcal-txcheck: pass PCL to tester (txpwr-cal-pcl)
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 20 Dec 2021 03:52:01 +0000
parents b313884c79fd
children c99b1dce04ec
line wrap: on
line source

/*
 * This module contains the Tx power measurement function.
 */

#include <stdio.h>
#include <stdlib.h>

extern char tsid_response[];

do_txpwr_cal_setup(band, arfcn)
	char *band;
	unsigned arfcn;
{
	char cmd[80];

	sprintf(cmd, "txpwr-cal-setup %s %u\n", band, arfcn);
	tsid_command(cmd);
	return(0);
}

pass_pcl_to_tester(pcl)
	unsigned pcl;
{
	char cmd[80];

	sprintf(cmd, "txpwr-cal-pcl %u\n", pcl);
	tsid_command(cmd);
	return(0);
}

double
tx_power_meas()
{
	double meas;

	tsid_command("power-meas\n");
	meas = atof(tsid_response + 1);
	return(meas);
}