annotate ffstools/caltools/fc-cal2bin.c @ 1014:961efadd530a default tip

fc-shell TCH DL handler: add support for CSD modes TCH DL capture mechanism in FC Tourmaline firmware has been extended to support CSD modes in addition to speech - add the necessary support on the host tools side. It needs to be noted that this mechanism in its present state does NOT provide the debug utility value that was sought: as we learned only after the code was implemented, TI's DSP has a misfeature in that the buffer we are reading (a_dd_0[]) is zeroed out when the IDS block is enabled, i.e., we are reading all zeros and not the real DL bits we were after. But since the code has already been written, we are keeping it - perhaps we can do some tests with IDS disabled.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Nov 2024 06:27:43 +0000
parents 5bcf12be0834
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
292
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This utility converts an RF table from ASCII to binary format.
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <sys/file.h>
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdio.h>
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <stdlib.h>
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <unistd.h>
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 main(argc, argv)
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 char **argv;
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 u_char buf[512];
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 unsigned size;
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 int ofd;
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 if (argc != 3) {
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 fprintf(stderr,
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 "usage: %s ascii-input-file binary-output-file\n",
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 argv[0]);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 exit(1);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 }
466
5bcf12be0834 ffstools/caltools: null pointer passing fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 292
diff changeset
24 if (read_rf_table_ext(argv[1], buf, 1, (char **) 0, &size))
292
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 exit(1);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ofd = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0666);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 if (ofd < 0) {
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 perror(argv[2]);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 exit(1);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 }
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 write(ofd, buf, size);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 close(ofd);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 exit(0);
0af5009bd52f fc-cal2bin written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 }