Example #1
0
 public SubmitSm(PduHeader header)
     : base(header)
 {
     VServiceType           = Protocol.ServiceType.Default;
     _vProtocolId           = 0;
     _vPriorityFlag         = PriorityFlag.Level0;
     _vScheduleDeliveryTime = "";
     _vValidityPeriod       = "";
     VRegisteredDelivery    = RegisteredDelivery.None;
     _vReplaceIfPresent     = false;
     VDataCoding            = DataCoding.Ascii;
     _vSmDefalutMessageId   = 0;
 }
Example #2
0
 public DeliverSm(PDUHeader header)
     : base(header)
 {
     vServiceType = Protocol.ServiceType.DEFAULT;
     vProtocolId = 0;
     vPriorityFlag = PriorityFlag.Level0;
     vScheduleDeliveryTime = "";
     vValidityPeriod = "";
     vRegisteredDelivery = RegisteredDelivery.None;
     vReplaceIfPresent = false;
     vDataCoding = DataCoding.ASCII;
     vSmDefalutMessageId = 0;
 }
Example #3
0
 public SubmitSm(PDUHeader header, SmppEncodingService smppEncodingService)
     : base(header, smppEncodingService)
 {
     vServiceType          = Protocol.ServiceType.DEFAULT;
     vProtocolId           = 0;
     vPriorityFlag         = PriorityFlag.Level0;
     vScheduleDeliveryTime = "";
     vValidityPeriod       = "";
     vRegisteredDelivery   = RegisteredDelivery.None;
     vReplaceIfPresent     = false;
     vDataCoding           = DataCoding.ASCII;
     vSmDefalutMessageId   = 0;
 }
Example #4
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);
            }
        }
Example #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); }
 }