FreeCalypso > hg > freecalypso-tools
annotate uptools/libcoding/number_decode.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 | ea41b6001848 |
children |
rev | line source |
---|---|
331
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This library module implements the decoding of number (address) digits. |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 char gsm_address_digits[16] = |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 {'0','1','2','3','4','5','6','7','8','9','*','#','a','b','c','?'}; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 decode_address_digits(inbuf, outbuf, ndigits) |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 u_char *inbuf; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 char *outbuf; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 unsigned ndigits; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 { |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 u_char *inp = inbuf; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 char *outp = outbuf; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 unsigned n = 0, b; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 while (n < ndigits) { |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 b = *inp++; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 *outp++ = gsm_address_digits[b & 0xF]; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 n++; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 if (n >= ndigits) |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 break; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 *outp++ = gsm_address_digits[b >> 4]; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 n++; |
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 } |
332
ea41b6001848
uptools/libcoding: SC address decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
331
diff
changeset
|
28 *outp = '\0'; |
331
110fffa1f001
uptools/libcoding: digit decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 } |