public SmgpSubmitRespMessage(byte[] buffer)
            : base(buffer)
        {
            Assert.AreEqual(SmgpRequestId.Submit_Resp, RequestId);
            var msgId = "";

            msgId += BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize, 3));
            msgId += "-" + BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize + 3, 4));
            msgId += "-" + BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize + 7, 3));
            MsgId  = msgId;
            Status = BitHelper.SubUInt32(buffer, HeaderSize + 10);
        }
Beispiel #2
0
        public SmgpDeliverMessage(byte[] buffer)
        {
            Assert.AreEqual(SmgpRequestId.Deliver, RequestId);

            MsgId = BitHelper.SubArray(buffer, HeaderSize, 10);

            msgIdBCD  = "";
            msgIdBCD += BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize, 3));
            msgIdBCD += "-" + BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize + 3, 4));
            msgIdBCD += "-" + BitHelper.BCD(BitHelper.SubArray(buffer, HeaderSize + 7, 3));

            IsReport   = BitHelper.SubUInt32(buffer, HeaderSize + 10, 1);
            MsgFormat  = BitHelper.SubUInt32(buffer, HeaderSize + 11, 1);
            RecvTime   = System.Text.Encoding.Default.GetString(buffer, HeaderSize + 12, 14);
            SrcTermId  = System.Text.Encoding.Default.GetString(buffer, HeaderSize + 26, 21);
            DestTermId = System.Text.Encoding.Default.GetString(buffer, HeaderSize + 47, 21);
            MsgLength  = BitHelper.SubUInt32(buffer, HeaderSize + 68, 1);
            MsgContent = System.Text.Encoding.Default.GetString(buffer, HeaderSize + 69, (int)MsgLength);
        }