comparison uptools/atcmd/smsend_pdugen.c @ 379:a38805b5b6d4

uptools/atcmd: smsend_pdugen.c split off from smsend_pduout.c
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 09 Mar 2018 00:27:24 +0000
parents uptools/atcmd/smsend_pduout.c@e61525f082bd
children
comparison
equal deleted inserted replaced
378:e61525f082bd 379:a38805b5b6d4
1 /*
2 * This module implements the encoding part of SMS sending/writing in PDU mode.
3 */
4
5 #include <sys/types.h>
6
7 send_in_pdu_mode(da, textsrc, textlen, udh, udhl)
8 u_char *da, *textsrc, *udh;
9 unsigned textlen, udhl;
10 {
11 u_char pdu[158];
12 unsigned pdulen;
13 char pduhex[317];
14
15 pdu[0] = 0;
16 pdulen = make_sms_submit_pdu(da, 0, 0, textsrc, textlen, udh, udhl,
17 pdu + 1);
18 make_hex_string(pdu, pdulen + 1, pduhex);
19 send_pdu_out(pduhex, pdulen);
20 }
21
22 send_pdu_ucs2(da, textsrc, textlen, udh, udhl)
23 u_char *da, *udh;
24 u_short *textsrc;
25 unsigned textlen, udhl;
26 {
27 u_char ucs2_be[140], pdu[158];
28 unsigned pdulen;
29 char pduhex[317];
30
31 ucs2_out_bigend(textsrc, ucs2_be, textlen);
32 pdu[0] = 0;
33 pdulen = make_sms_submit_pdu_8bit(da, 0, 0x08, ucs2_be, textlen * 2,
34 udh, udhl, pdu + 1);
35 make_hex_string(pdu, pdulen + 1, pduhex);
36 send_pdu_out(pduhex, pdulen);
37 }