changeset 290:94234e9c843b

fc-tmsync: rftr save to file implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 18 Nov 2017 06:35:13 +0000
parents 329c31f7c797
children dd97e75620a7
files rvinterf/etmsync/l1tmcmd.c rvinterf/etmsync/tmscmdtab.c
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/etmsync/l1tmcmd.c	Sat Nov 18 02:01:57 2017 +0000
+++ b/rvinterf/etmsync/l1tmcmd.c	Sat Nov 18 06:35:13 2017 +0000
@@ -20,6 +20,7 @@
 extern void write_agcwords_table();
 extern void write_agcglobals_table();
 extern void write_il2agc_table();
+extern void write_tx_ramps_table();
 extern void write_tx_levels_table();
 extern void write_tx_calchan_table();
 extern void write_tx_caltemp_table();
@@ -191,6 +192,7 @@
 	struct table_map *tp;
 	u_char table_data[MAX_RF_TABLE_SIZE];
 	int rc;
+	FILE *of;
 
 	if (keyword_or_num(argv[1], rf_table_arg, &index))
 		return(ERROR_USAGE);
@@ -206,7 +208,16 @@
 	rc = do_rftr(index, table_data, tp->size);
 	if (rc)
 		return(rc);
-	tp->func(table_data, stdout);
+	if (argv[2]) {
+		of = fopen(argv[2], "w");
+		if (!of) {
+			perror(argv[2]);
+			return(ERROR_UNIX);
+		}
+		tp->func(table_data, of);
+		fclose(of);
+	} else
+		tp->func(table_data, stdout);
 	return(0);
 }
 
--- a/rvinterf/etmsync/tmscmdtab.c	Sat Nov 18 02:01:57 2017 +0000
+++ b/rvinterf/etmsync/tmscmdtab.c	Sat Nov 18 06:35:13 2017 +0000
@@ -26,7 +26,7 @@
 	{"pirelli-get-imei", 0, 0, get_pirelli_imei},
 	{"rfpr", 1, 1, cmd_rfpr},
 	{"rfpw", 2, 3, cmd_rfpw},
-	{"rftr", 1, 1, cmd_rftr},
+	{"rftr", 1, 2, cmd_rftr},
 	{"tms", 1, 1, cmd_tms},
 	{"ttr", 1, 1, cmd_ttr},
 	{0, 0, 0, 0}