/// <summary> Called to return the PDU for this type of object </summary> /// <returns> byte[] </returns> public byte[] GetPDU() { SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this); tmpBuff.AddCString(MessageId); if (Optional.Count > 0) { tmpBuff.AddTLVCollection(Optional); } tmpBuff.AddFinalLength(); return tmpBuff.Buffer; }
/// <summary> Called to return the PDU for this type of object </summary> /// <returns> A byte array </returns> public byte[] GetPDU() { if (UserData.Headers.Count > 0) { EsmClass |= 0x40; } SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this); tmpBuff.AddCString(ServiceType); tmpBuff.AddByte(SourceTon); tmpBuff.AddByte(SourceNpi); tmpBuff.AddCString(SourceAddr); tmpBuff.AddByte(DestTon); tmpBuff.AddByte(DestNpi); tmpBuff.AddCString(DestAddr); tmpBuff.AddByte(EsmClass); tmpBuff.AddByte(ProtocolId); tmpBuff.AddByte(PriorityFlag); tmpBuff.AddTimeString(ScheduleDeliveryTime, 17); tmpBuff.AddTimeString(ValidityPeriod, 17); tmpBuff.AddByte(RegisteredDelivery); tmpBuff.AddByte(ReplaceIfPresent); tmpBuff.AddByte((byte) DataCoding); tmpBuff.AddByte(DefaultMessageId); tmpBuff.AddUserData(UserData); tmpBuff.AddTLVCollection(Optional); tmpBuff.AddFinalLength(); return tmpBuff.Buffer; }
/// <summary> Called to return the PDU for this type of object </summary> /// <returns> byte[] </returns> public byte[] GetPDU() { if (UserData.Headers.Count > 0) { EsmClass |= 0x40; } SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this); tmpBuff.AddCString(ServiceType); tmpBuff.AddByte(SourceTon); tmpBuff.AddByte(SourceNpi); tmpBuff.AddCString(SourceAddr); tmpBuff.AddByte(DestTon); tmpBuff.AddByte(DestNpi); tmpBuff.AddCString(DestAddr); tmpBuff.AddByte(EsmClass); tmpBuff.AddByte(RegisteredDelivery); tmpBuff.AddByte((byte) DataCoding); tmpBuff.AddTLVCollection(Optional); tmpBuff.AddFinalLength(); return tmpBuff.Buffer; }