annotate uptools/atcmd/smsend_pdugen.c @ 702:36e6a1ff9608

lunadrv: rd and wr commands added
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 07 May 2020 02:40:13 +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 }