FreeCalypso > hg > freecalypso-tools
comparison uptools/libcoding/sms_submit.c @ 374:d1fa771abeb8
uptools: make_sms_submit_pdu() in libcoding now takes PID and DCS arguments
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 08 Mar 2018 20:33:03 +0000 |
parents | 68c8cf672ecd |
children |
comparison
equal
deleted
inserted
replaced
373:1fa4dcbb1c87 | 374:d1fa771abeb8 |
---|---|
4 */ | 4 */ |
5 | 5 |
6 #include <sys/types.h> | 6 #include <sys/types.h> |
7 #include <strings.h> | 7 #include <strings.h> |
8 | 8 |
9 make_sms_submit_pdu(da, textsrc, textlen, udh, udhl, outbuf) | 9 make_sms_submit_pdu(da, pid, dcs, textsrc, textlen, udh, udhl, outbuf) |
10 u_char *da, *textsrc, *udh, *outbuf; | 10 u_char *da, *textsrc, *udh, *outbuf; |
11 unsigned textlen, udhl; | 11 unsigned textlen, udhl; |
12 { | 12 { |
13 u_char *outp = outbuf; | 13 u_char *outp = outbuf; |
14 unsigned addr_field_len; | 14 unsigned addr_field_len; |
22 *outp++ = 0x01; | 22 *outp++ = 0x01; |
23 *outp++ = 0; | 23 *outp++ = 0; |
24 addr_field_len = ((da[0] + 1) >> 1) + 2; | 24 addr_field_len = ((da[0] + 1) >> 1) + 2; |
25 bcopy(da, outp, addr_field_len); | 25 bcopy(da, outp, addr_field_len); |
26 outp += addr_field_len; | 26 outp += addr_field_len; |
27 *outp++ = 0; | 27 *outp++ = pid; |
28 *outp++ = 0; | 28 *outp++ = dcs; |
29 if (udh) { | 29 if (udh) { |
30 udh_octets = udhl + 1; | 30 udh_octets = udhl + 1; |
31 udh_chars = (udh_octets * 8 + 6) / 7; | 31 udh_chars = (udh_octets * 8 + 6) / 7; |
32 } else { | 32 } else { |
33 udh_octets = 0; | 33 udh_octets = 0; |