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
namespace AsiaINFO.SMS.CMPP2
{
    using System;
 
    public class CMPP_DELIVER_RESP
    {
        private MessageHeader _Header;
        private ulong _Msg_Id;
        private uint _Result;
        private uint _Sequence_Id;
        public const int Bodylength = 9;
 
        public CMPP_DELIVER_RESP(ulong Msg_Id, uint Result, uint Sequence_Id)
        {
            this._Msg_Id = Msg_Id;
            this._Result = Result;
            this._Sequence_Id = Sequence_Id;
        }
 
        public byte[] ToBytes()
        {
            int index = 0;
            byte[] dst = new byte[0x15];
            byte[] src = new byte[12];
            this._Header = new MessageHeader(0x15, CMPP_Command_Id.CMPP_DELIVER_RESP, this._Sequence_Id);
            src = this._Header.ToBytes();
            Buffer.BlockCopy(src, 0, dst, 0, src.Length);
            index += 12;
            src = BitConverter.GetBytes(this._Msg_Id);
            Array.Reverse(src);
            src.CopyTo(dst, index);
            index += 8;
            dst[index] = (byte) this._Result;
            return dst;
        }
 
        public override string ToString()
        {
            return (this._Header.ToString() + "\r\n" + string.Format("[\r\nMessageBody:\r\n\tMsg_Id: {0}\r\n\tResult: {1}\r\n]", this._Msg_Id, this._Result));
        }
    }
}