annotate uptools/libcoding/sms_submit8.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 759cb6dc501b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
375
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This library module implements the function for constructing outgoing
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * SMS-SUBMIT PDUs, 8-bit version for raw data or UCS-2.
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <sys/types.h>
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <strings.h>
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 make_sms_submit_pdu_8bit(da, pid, dcs, textsrc, textlen, udh, udhl, outbuf)
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 u_char *da, *textsrc, *udh, *outbuf;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 unsigned textlen, udhl;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 {
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 u_char *outp = outbuf;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 unsigned addr_field_len;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 unsigned udh_octets;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 unsigned udl;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 if (udh)
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 *outp++ = 0x41;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 else
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 *outp++ = 0x01;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 *outp++ = 0;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 addr_field_len = ((da[0] + 1) >> 1) + 2;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 bcopy(da, outp, addr_field_len);
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 outp += addr_field_len;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 *outp++ = pid;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 *outp++ = dcs;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 if (udh)
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 udh_octets = udhl + 1;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 else
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 udh_octets = 0;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 udl = udh_octets + textlen;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 *outp++ = udl;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 if (udh) {
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 *outp++ = udhl;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 bcopy(udh, outp, udhl);
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 outp += udhl;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 }
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 bcopy(textsrc, outp, textlen);
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 outp += textlen;
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 return (outp - outbuf);
759cb6dc501b uptools/libcoding: added function for generating SMS PDUs with 8-bit text
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 }