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));
|
}
|
}
|
}
|