changeset 122:cad9129d0f03

fc-tmsh: rftw command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 19 Feb 2017 08:47:10 +0000
parents 4070847293a9
children bc23c1cd30ae
files rvinterf/tmsh/l1cmd.c
diffstat 1 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/l1cmd.c	Sun Feb 19 08:32:37 2017 +0000
+++ b/rvinterf/tmsh/l1cmd.c	Sun Feb 19 08:47:10 2017 +0000
@@ -277,3 +277,47 @@
 	send_etm_cmd(cmdpkt, 3);
 	return(0);
 }
+
+static struct kwtab rf_table_arg[] = {
+	{"rx-agc-table", RX_AGC_TABLE},
+	{"afcparams", AFC_PARAMS},
+	{"rx-agc-global-params", RX_AGC_GLOBAL_PARAMS},
+	{"rx-il2agc-max", RX_IL_2_AGC_MAX},
+	{"rx-il2agc-pwr", RX_IL_2_AGC_PWR},
+	{"rx-il2agc-av", RX_IL_2_AGC_AV},
+	{"tx-levels", TX_LEVELS},
+	{"tx-calchan", TX_CAL_CHAN},
+	{"tx-caltemp", TX_CAL_TEMP},
+	{"tx-cal-extreme", TX_CAL_EXTREME},
+	{"rx-calchan", RX_CAL_CHAN},
+	{"rx-caltemp", RX_CAL_TEMP},
+	{"rx-cal-level", RX_CAL_LEVEL},
+	{"rx-agcparams", RX_AGC_PARAMS},
+	{"rx-agcparams-pcs", RX_AGC_PARAMS_PCS},
+	{"tx-data-buffer", TX_DATA_BUFFER},
+	{"rlc-tx-buffer-cs1", RLC_TX_BUFFER_CS1},
+	{"rlc-tx-buffer-cs2", RLC_TX_BUFFER_CS2},
+	{"rlc-tx-buffer-cs3", RLC_TX_BUFFER_CS3},
+	{"rlc-tx-buffer-cs4", RLC_TX_BUFFER_CS4},
+	{0, 0}
+};
+
+cmd_rftw(argc, argv)
+	char **argv;
+{
+	u16 index;
+	u_char cmdpkt[MAX_RF_TABLE_SIZE + 4];
+	int rc;
+	char *format;
+	unsigned size;
+
+	if (keyword_or_num(argv[1], rf_table_arg, &index))
+		return(ERROR_USAGE);
+	cmdpkt[1] = RF_TABLE_WRITE;
+	cmdpkt[2] = index;
+	rc = read_rf_table(argv[2], cmdpkt + 3, &format, &size);
+	if (rc)
+		return(rc);
+	send_etm_cmd(cmdpkt, size + 2);
+	return(0);
+}