annotate rvinterf/asyncshell/tchplay.c @ 964:a96cb97b66a2

ringtools/imy: fix duplicate definition of tdma_durations[] The bug was reported by Vadim Yanitskiy <fixeria@osmocom.org>, although the present fix is slightly different from the contributed patch: because main.c doesn't need this tdma_durations[] array at all, let's simply remove the reference to this array from main.c rather than turn it into an extern. I no longer remember my original thought flow that resulted (by mistake) in tdma_durations[] being multiply defined in main.c and durations.c. My intent might have been to define all globals in main.c and have the reference in durations.c be an extern - and I missed that extern - but without clear memory, I have no certainty. In any case, having this data array defined in the same module that fills it (durations.c) is sensible, so let's make it the new way.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 31 Aug 2023 19:38:18 +0000
parents 971906d7763d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * TCH uplink play-from-file functionality
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
6 #include <ctype.h>
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdio.h>
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <string.h>
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <strings.h>
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <stdlib.h>
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include "pktmux.h"
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include "tch_feature.h"
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 extern u_char rvi_msg[];
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 extern int rvi_msg_len;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 extern void async_msg_output();
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
19 static FILE *play_file;
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 static int queued_frames;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #define QUEUE_LIMIT 3
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 static void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 sync_msgout(msg)
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 char *msg;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 {
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 printf("%s\n", msg);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
31 static
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
32 decode_hex_digit(ch)
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
33 {
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
34 if (isdigit(ch))
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
35 return(ch - '0');
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
36 else if (isupper(ch))
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
37 return(ch - 'A' + 10);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
38 else
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
39 return(ch - 'a' + 10);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
40 }
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
41
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
42 static
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
43 decode_hex_line(line, bytes)
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
44 char *line;
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
45 u_char *bytes;
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
46 {
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
47 int i;
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
48
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
49 for (i = 0; i < 33; i++) {
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
50 if (!isxdigit(line[0]) || !isxdigit(line[1]))
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
51 return(-1);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
52 bytes[i] = (decode_hex_digit(line[0]) << 4) |
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
53 decode_hex_digit(line[1]);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
54 line += 2;
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
55 }
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
56 for (; *line; line++)
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
57 if (!isspace(*line))
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
58 return(-1);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
59 return(0);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
60 }
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
61
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 static void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 fill_uplink(msgout)
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 void (*msgout)();
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 {
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
66 char line[80];
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
67 u_char sendpkt[35];
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 int cc;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 sendpkt[0] = RVT_TCH_HEADER;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 sendpkt[1] = TCH_ULBITS_REQ;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 while (queued_frames < QUEUE_LIMIT) {
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
73 if (!fgets(line, sizeof line, play_file)) {
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 msgout("TCH UL: file play finished");
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
75 fclose(play_file);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
76 play_file = 0;
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 }
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
79 if (decode_hex_line(line, sendpkt + 2) < 0) {
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 msgout("TCH UL: bad file input, play aborted");
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
81 fclose(play_file);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
82 play_file = 0;
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 send_pkt_to_target(sendpkt, 35);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 queued_frames++;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 tch_ulbits_conf()
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 {
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 if (queued_frames > 0)
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 queued_frames--;
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
95 if (play_file)
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 fill_uplink(async_msg_output);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 static void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 cmd_tch_play_start(filename)
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 char *filename;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 {
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
103 if (play_file) {
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 printf("error: tch play session already in progress\n");
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 }
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
107 play_file = fopen(filename, "r");
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
108 if (!play_file) {
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 perror(filename);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 printf("Starting TCH UL play from file\n");
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 tch_rx_control(1);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 fill_uplink(sync_msgout);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 static void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 cmd_tch_play_stop()
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 {
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
120 if (!play_file) {
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 printf("error: no tch play session in progress\n");
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 }
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
124 fclose(play_file);
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
125 play_file = 0;
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 printf("TCH UL play from file terminated\n");
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 cmd_tch_play(argc, argv)
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 char **argv;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 {
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 if (argc < 2) {
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 printf("error: too few arguments\n");
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 return;
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 if (strcmp(argv[1], "stop"))
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 cmd_tch_play_start(argv[1]);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 else
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 cmd_tch_play_stop();
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 }
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 void
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 show_tch_play_status()
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 {
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 printf("TCH UL play from file: %s\n",
4
971906d7763d fc-shell tch commands: changed to raw hex file format
Mychaela Falconia <falcon@freecalypso.org>
parents: 0
diff changeset
147 play_file ? "RUNNING" : "not running");
0
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 printf("Outstanding UL frames: %d\n", queued_frames);
e7502631a0f9 initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 }