wzp
2021-07-28 864986e4cad03f6b9bba9a7e65379db496b62a6a
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
namespace AsiaINFO.SMS.CMPP2
{
    using System;
    using System.Text;
 
    public class CMPP_QUERY_RESP
    {
        private MessageHeader _Header;
        private uint _MO_FL;
        private uint _MO_Scs;
        private uint _MO_WT;
        private uint _MT_FL;
        private uint _MT_Scs;
        private uint _MT_TLMsg;
        private uint _MT_Tlusr;
        private uint _MT_WT;
        private string _Query_Code;
        private uint _Query_Type;
        private string _Time;
        public const int BodyLength = 0x33;
 
        public CMPP_QUERY_RESP(byte[] bytes)
        {
            int srcOffset = 0;
            byte[] dst = new byte[12];
            Buffer.BlockCopy(bytes, 0, dst, 0, dst.Length);
            this._Header = new MessageHeader(dst);
            srcOffset += 12;
            dst = new byte[8];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            this._Time = Encoding.ASCII.GetString(dst);
            srcOffset += 8;
            this._Query_Type = bytes[srcOffset++];
            dst = new byte[10];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            this._Query_Code = Encoding.ASCII.GetString(dst);
            srcOffset += 10;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MT_TLMsg = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MT_Tlusr = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MT_Scs = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MT_WT = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MT_FL = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MO_Scs = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MO_WT = BitConverter.ToUInt32(dst, 0);
            srcOffset += 4;
            dst = new byte[4];
            Buffer.BlockCopy(bytes, srcOffset, dst, 0, dst.Length);
            Array.Reverse(dst);
            this._MO_FL = BitConverter.ToUInt32(dst, 0);
        }
 
        public override string ToString()
        {
            return ("[\r\n" + this._Header.ToString() + "\r\n" + string.Format("\tMessageBody:\r\n\t\tBodyLength: {0}\r\n\t\tMO_FL: {1}\r\n\t\tMO_Scs: {2}\r\n\t\tMO_WT: {3}\r\n\t\tMT_FL: {4}\r\n\t\tMT_Scs: {5}\r\n\t\tMT_TLMsg: {6}\r\n\t\tMT_Tlusr: {7}\r\n\t\tMT_WT: {8}\r\n\t\tQuery_Code: {9}\r\n\t\tQuery_Type: {10}\r\n\t\tTime: {11}", new object[] { 0x33, this._MO_FL, this._MO_Scs, this._MO_WT, this._MT_FL, this._MT_Scs, this._MT_TLMsg, this._MT_Tlusr, this._MT_WT, this._Query_Code, this._Query_Type, this._Time }) + "\r\n]");
        }
 
        public MessageHeader Header
        {
            get
            {
                return this._Header;
            }
        }
 
        public uint MO_FL
        {
            get
            {
                return this._MO_FL;
            }
        }
 
        public uint MO_Scs
        {
            get
            {
                return this._MO_Scs;
            }
        }
 
        public uint MO_WT
        {
            get
            {
                return this._MO_WT;
            }
        }
 
        public uint MT_FL
        {
            get
            {
                return this._MT_FL;
            }
        }
 
        public uint Mt_Scs
        {
            get
            {
                return this._MT_Scs;
            }
        }
 
        public uint Mt_TlMsg
        {
            get
            {
                return this._MT_TLMsg;
            }
        }
 
        public uint Mt_Tlusr
        {
            get
            {
                return this._MT_Tlusr;
            }
        }
 
        public uint MT_WT
        {
            get
            {
                return this._MT_WT;
            }
        }
 
        public string Query_Code
        {
            get
            {
                return this._Query_Code;
            }
        }
 
        public uint Query_Type
        {
            get
            {
                return this._Query_Type;
            }
        }
 
        public string Time
        {
            get
            {
                return this._Time;
            }
        }
    }
}