コード例 #1
0
 protected override void Parse(ByteBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     vSourceAddress = SmppAddress.Parse(buffer);
     vEsmeAddress   = SmppAddress.Parse(buffer);
     //If there are some bytes left,
     //construct a tlv collection
     if (buffer.Length > 0)
     {
         vTlv = TlvCollection.Parse(buffer);
     }
 }
コード例 #2
0
 protected override void Parse(ByteBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     vMessageID     = DecodeCString(buffer);
     vSourceAddress = SmppAddress.Parse(buffer);
     //This pdu has no option parameters
     //If there is still something in the buffer,
     //we then have more than required bytes
     if (buffer.Length > 0)
     {
         throw new TooManyBytesException();
     }
 }
コード例 #3
0
 protected override void Parse(ByteBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     vServiceType        = DecodeCString(buffer, vSmppEncodingService);
     vSourceAddress      = SmppAddress.Parse(buffer, vSmppEncodingService);
     vDestinationAddress = SmppAddress.Parse(buffer, vSmppEncodingService);
     vEsmClass           = (EsmClass)GetByte(buffer);
     vRegisteredDelivery = (RegisteredDelivery)GetByte(buffer);
     vDataCoding         = (DataCoding)GetByte(buffer);
     if (buffer.Length > 0)
     {
         vTlv = TlvCollection.Parse(buffer, vSmppEncodingService);
     }
 }
コード例 #4
0
 protected override void Parse(ByteBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     vMessageID            = DecodeCString(buffer);
     vSourceAddress        = SmppAddress.Parse(buffer);
     vScheduleDeliveryTime = DecodeCString(buffer);
     vValidityPeriod       = DecodeCString(buffer);
     vRegisteredDelivery   = (RegisteredDelivery)GetByte(buffer);
     vSmDefaultMessageID   = GetByte(buffer);
     vSmLength             = GetByte(buffer);
     vShortMessage         = DecodeString(buffer, (int)vSmLength);
     //This pdu has no option parameters,
     //If there is something left in the buffer,
     //then we have more than required bytes
     if (buffer.Length > 0)
     {
         throw new TooManyBytesException();
     }
 }
コード例 #5
0
        protected override void Parse(ByteBuffer buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }
            VServiceType           = DecodeCString(buffer);
            VSourceAddress         = SmppAddress.Parse(buffer);
            VDestinationAddress    = SmppAddress.Parse(buffer);
            VEsmClass              = (EsmClass)GetByte(buffer);
            _vProtocolId           = GetByte(buffer);
            _vPriorityFlag         = (PriorityFlag)GetByte(buffer);
            _vScheduleDeliveryTime = DecodeCString(buffer);
            _vValidityPeriod       = DecodeCString(buffer);
            VRegisteredDelivery    = (RegisteredDelivery)GetByte(buffer);
            _vReplaceIfPresent     = GetByte(buffer) == 0 ? false : true;
            VDataCoding            = (DataCoding)GetByte(buffer);
            _vSmDefalutMessageId   = GetByte(buffer);
            int length = GetByte(buffer);

            if (length == 0)
            {
                _vMessageBytes = null;
            }
            else
            {
                if (length > buffer.Length)
                {
                    throw new NotEnoughBytesException("Pdu encoutered less bytes than indicated by message length");
                }
                _vMessageBytes = buffer.Remove(length);
            }
            if (buffer.Length > 0)
            {
                VTlv = TlvCollection.Parse(buffer);
            }
        }