Exemple #1
0
        protected override byte[] GetBodyData()
        {
            ByteBuffer buffer = new ByteBuffer();

            buffer.Append(EncodeCString(VServiceType));
            buffer.Append(VSourceAddress.GetBytes());
            buffer.Append(VDestinationAddress.GetBytes());
            buffer.Append((byte)VEsmClass);
            buffer.Append((byte)VRegisteredDelivery);
            buffer.Append((byte)VDataCoding);
            return(buffer.ToBytes());
        }
Exemple #2
0
        protected override byte[] GetBodyData()
        {
            ByteBuffer buffer = new ByteBuffer(256);

            buffer.Append(EncodeCString(VServiceType));
            buffer.Append(VSourceAddress.GetBytes());
            buffer.Append(VDestinationAddress.GetBytes());
            buffer.Append((byte)VEsmClass);
            buffer.Append(_vProtocolId);
            buffer.Append((byte)_vPriorityFlag);
            buffer.Append(EncodeCString(_vScheduleDeliveryTime));
            buffer.Append(EncodeCString(_vValidityPeriod));
            buffer.Append((byte)VRegisteredDelivery);
            buffer.Append(_vReplaceIfPresent ? (byte)1 : (byte)0);
            buffer.Append((byte)VDataCoding);
            buffer.Append(_vSmDefalutMessageId);
            //Check if vMessageBytes is not null
            if (_vMessageBytes == null)
            {
                //Check whether optional field is used
                if (VTlv.GetTlvByTag(Tag.MessagePayload) == null)
                {
                    //Create an empty message
                    _vMessageBytes = new byte[] { 0x00 };
                }
            }
            if (_vMessageBytes == null)
            {
                buffer.Append(0);
            }
            else
            {
                buffer.Append((byte)_vMessageBytes.Length);
                buffer.Append(_vMessageBytes);
            }
            return(buffer.ToBytes());
        }