1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 package org.marre.sms.transport.ucp;
36
37 import org.marre.util.StringUtil;
38
39 /***
40 *
41 * @author Markus Eriksson
42 * @version $Id: UcpSeries50.java,v 1.10 2005/11/26 16:37:14 c95men Exp $
43 */
44 public class UcpSeries50 extends UcpMsg
45 {
46 public static final byte OP_SUBMIT_SHORT_MESSAGE = 51;
47 public static final byte OP_DELIVER_SHORT_MESSAGE = 52;
48 public static final byte OP_DELIVER_NOTIFICATION = 53;
49 public static final byte OP_MODIFY_MESSAGE = 54;
50 public static final byte OP_INQUIRY_MESSAGE = 55;
51 public static final byte OP_DELETE_MESSAGE = 56;
52 public static final byte OP_RESPONSE_INQUIRY_MESSAGE = 57;
53 public static final byte OP_RESPONSE_DELETE_MESSAGE = 58;
54
55 public static final byte XSER_TYPE_UDH = 1;
56 public static final byte XSER_TYPE_DCS = 2;
57
58 protected static final int FIELD_ADC = 0;
59 protected static final int FIELD_OADC = 1;
60 protected static final int FIELD_AC = 2;
61 protected static final int FIELD_NRQ = 3;
62 protected static final int FIELD_NADC = 4;
63 protected static final int FIELD_NT = 5;
64 protected static final int FIELD_NPID = 6;
65 protected static final int FIELD_LRQ = 7;
66 protected static final int FIELD_LRAD = 8;
67 protected static final int FIELD_LPID = 9;
68 protected static final int FIELD_DD = 10;
69 protected static final int FIELD_DDT = 11;
70 protected static final int FIELD_VP = 12;
71 protected static final int FIELD_RPID = 13;
72 protected static final int FIELD_SCTS = 14;
73 protected static final int FIELD_DST = 15;
74 protected static final int FIELD_RSN = 16;
75 protected static final int FIELD_DSCTS = 17;
76 protected static final int FIELD_MT = 18;
77 protected static final int FIELD_NB = 19;
78 protected static final int FIELD_MSG = 20;
79 protected static final int FIELD_MMS = 21;
80 protected static final int FIELD_PR = 22;
81 protected static final int FIELD_DCS = 23;
82 protected static final int FIELD_MCLS = 24;
83 protected static final int FIELD_RPI = 25;
84 protected static final int FIELD_CPG = 26;
85 protected static final int FIELD_RPLY = 27;
86 protected static final int FIELD_OTOA = 28;
87 protected static final int FIELD_HPLMN = 29;
88 protected static final int FIELD_XSER = 30;
89 protected static final int FIELD_RES4 = 31;
90 protected static final int FIELD_RES5 = 32;
91
92 public UcpSeries50(byte operation)
93 {
94 super(33);
95 setOR('O');
96 setOT(operation);
97 }
98
99 public void clearXSer()
100 {
101 ucpFields_[FIELD_XSER] = null;
102 }
103
104 public void addXSer(byte type, byte data)
105 {
106 StringBuffer xSerBuff = new StringBuffer();
107
108 xSerBuff.append(StringUtil.byteToHexString(type));
109 xSerBuff.append("01");
110 xSerBuff.append(StringUtil.byteToHexString(data));
111
112 ucpFields_[FIELD_XSER] = (ucpFields_[FIELD_XSER] == null) ? (xSerBuff.toString())
113 : (ucpFields_[FIELD_XSER] + xSerBuff.toString());
114 }
115
116 public void addXSer(byte type, byte[] data)
117 {
118 StringBuffer xSerBuff = new StringBuffer();
119
120 xSerBuff.append(StringUtil.byteToHexString(type));
121 xSerBuff.append(StringUtil.byteToHexString((byte) (data.length + 1 & 0xff)));
122 xSerBuff.append(StringUtil.byteToHexString((byte) (data.length & 0xff)));
123 xSerBuff.append(StringUtil.bytesToHexString(data));
124
125 ucpFields_[FIELD_XSER] = (ucpFields_[FIELD_XSER] == null) ? (xSerBuff.toString())
126 : (ucpFields_[FIELD_XSER] + xSerBuff.toString());
127 }
128 }