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); } }
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); } }
protected override void Parse(ByteBuffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } //We require at least 1 byte for this pdu if (buffer.Length < 1) { throw new NotEnoughBytesException("data_sm_resp requires at least 1 byte of body data"); } _vMessageId = DecodeCString(buffer); if (buffer.Length > 0) { VTlv = TlvCollection.Parse(buffer); } }
protected override void Parse(ByteBuffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } //If Error code is not zero, buffer.Length may be zero //This may happen because the SMSC may not return the system_id field //if the origianl bind request contained an error. if (Header.ErrorCode != SmppErrorCode.EsmeRok && buffer.Length == 0) { _vSystemId = ""; return; } //Otherwise, there must be something in the buffer _vSystemId = DecodeCString(buffer); if (buffer.Length > 0) { VTlv = TlvCollection.Parse(buffer); } }
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); } }