annotate uptools/atcmd/smsend_pdugen.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 a38805b5b6d4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
362
89fe66cb60f6 fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
379
a38805b5b6d4 uptools/atcmd: smsend_pdugen.c split off from smsend_pduout.c
Mychaela Falconia <falcon@freecalypso.org>
parents: 378
diff changeset
2 * This module implements the encoding part of SMS sending/writing in PDU mode.
362
89fe66cb60f6 fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
89fe66cb60f6 fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
89fe66cb60f6 fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
378
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
6
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
7 send_in_pdu_mode(da, textsrc, textlen, udh, udhl)
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
8 u_char *da, *textsrc, *udh;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
9 unsigned textlen, udhl;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
10 {
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
11 u_char pdu[158];
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
12 unsigned pdulen;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
13 char pduhex[317];
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
14
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
15 pdu[0] = 0;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
16 pdulen = make_sms_submit_pdu(da, 0, 0, textsrc, textlen, udh, udhl,
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
17 pdu + 1);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
18 make_hex_string(pdu, pdulen + 1, pduhex);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
19 send_pdu_out(pduhex, pdulen);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
20 }
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
21
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
22 send_pdu_ucs2(da, textsrc, textlen, udh, udhl)
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
23 u_char *da, *udh;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
24 u_short *textsrc;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
25 unsigned textlen, udhl;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
26 {
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
27 u_char ucs2_be[140], pdu[158];
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
28 unsigned pdulen;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
29 char pduhex[317];
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
30
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
31 ucs2_out_bigend(textsrc, ucs2_be, textlen);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
32 pdu[0] = 0;
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
33 pdulen = make_sms_submit_pdu_8bit(da, 0, 0x08, ucs2_be, textlen * 2,
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
34 udh, udhl, pdu + 1);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
35 make_hex_string(pdu, pdulen + 1, pduhex);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
36 send_pdu_out(pduhex, pdulen);
e61525f082bd uptools/atcmd/smsend_pduout.c: added UCS-2 function, some refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 374
diff changeset
37 }