FreeCalypso > hg > freecalypso-tools
annotate uptools/libcoding/grokdcs.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 | 097ce8431d11 |
children |
rev | line source |
---|---|
335
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This library module implements the function that distills the complex |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * set of possible SMS DCS octet values to just one of 4 possibilities: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * 7-bit text (7), 8-bit data octets (8), UCS-2 text (16) or compressed |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * data (9). |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * The decoding is based on the 3GPP TS 23.038 V11.0.0 spec; |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * reserved encodings are treated as 7-bit text as the spec instructs. |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 */ |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 sms_dcs_classify(dcs) |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 if (!(dcs & 0x80)) { |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 if (dcs & 0x20) |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 return(9); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 switch (dcs & 0xC) { |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 case 0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 return(7); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 case 4: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 return(8); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 case 8: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 return(16); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 default: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 /* reserved, treating as 7-bit per the spec */ |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 return(7); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 } |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 } |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 switch (dcs & 0xF0) { |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 case 0x80: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 case 0x90: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 case 0xA0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 case 0xB0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* reserved, treating as 7-bit per the spec */ |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 return(7); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 case 0xC0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 case 0xD0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 return(7); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 case 0xE0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 return(16); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 case 0xF0: |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 if (dcs & 4) |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 return(8); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 else |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 return(7); |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 } |
097ce8431d11
uptools/libcoding: SMS DCS decoding implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 } |