/// <summary> Concatenates the specify message </summary> /// <param name="defaultEncoding"></param> /// <param name="msgRef"></param> /// <param name="total"></param> /// <param name="seqNum"></param> public void AddConcatenatedShortMessages8bit(DataCodings defaultEncoding, byte msgRef, byte total, byte seqNum) { SmppBuffer tmpBuff = new SmppBuffer(defaultEncoding); tmpBuff.AddByte(msgRef); tmpBuff.AddByte(total); tmpBuff.AddByte(seqNum); Add(UserDataHeader.Create(InformationElementIdentifiers.ConcatenatedShortMessages8bit, Convert.ToByte(tmpBuff.Length), 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.AddDestinationAddresses(DestinationAddresses); 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(Convert.ToByte(DataCoding)); tmpBuff.AddByte(DefaultMsgId); 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() { SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this); tmpBuff.AddCString(MessageId); tmpBuff.AddByte(SourceTon); tmpBuff.AddByte(SourceNpi); tmpBuff.AddCString(SourceAddr); tmpBuff.AddFinalLength(); return(tmpBuff.Buffer); }
/// <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); tmpBuff.AddCString(FinalDateString); tmpBuff.AddByte((byte)MessageState); tmpBuff.AddByte((byte)ErrorCode); tmpBuff.AddFinalLength(); return(tmpBuff.Buffer); }
/// <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(SystemId); tmpBuff.AddCString(Password); tmpBuff.AddCString(SystemType); tmpBuff.AddByte(InterfaceVersion); tmpBuff.AddByte(AddrTon); tmpBuff.AddByte(AddrNpi); tmpBuff.AddCString(AddressRange); tmpBuff.AddFinalLength(); return(tmpBuff.Buffer); }
/// <summary> Adds the SAR total segments </summary> /// <param name="val"></param> public void AddSARTotalSegments(byte val) { SmppBuffer tmpBuff = new SmppBuffer(DataCodings.Default); tmpBuff.AddByte(val); Add(TLV.Create(OptionalTags.SarTotalSegments, Convert.ToUInt16(tmpBuff.Length), tmpBuff.Buffer)); }
/// <summary> Adds the SAR sequence number </summary> /// <param name="val"></param> public void AddSARSequenceNumber(byte val) { SmppBuffer tmpBuff = new SmppBuffer(DataCodings.Default); tmpBuff.AddByte(val); Add(TLV.Create(OptionalTags.SarSegmentSeqnum, Convert.ToUInt16(tmpBuff.Length), 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); }
/// <summary> Called to return the PDU for this type of object </summary> /// <returns> byte[] </returns> public byte[] GetPDU() { // Create buffer and add header information SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this); // Add properties tmpBuff.AddCString(ServiceType); tmpBuff.AddCString(MessageId); tmpBuff.AddByte(SourceTon); tmpBuff.AddByte(SourceNpi); tmpBuff.AddCString(SourceAddr); tmpBuff.AddByte(DestTon); tmpBuff.AddByte(DestNpi); tmpBuff.AddCString(DestAddr); // Insert final length tmpBuff.AddFinalLength(); // Return byte array return(tmpBuff.Buffer); }
/// <summary> Adds the more messages to send </summary> /// <param name="val"></param> public void AddMoreMessagesToSend(bool val) { byte b = 0; if (val) { b = 1; } SmppBuffer tmpBuff = new SmppBuffer(DataCodings.Default); tmpBuff.AddByte(b); Add(TLV.Create(OptionalTags.MoreMessagesToSend, Convert.ToUInt16(tmpBuff.Length), tmpBuff.Buffer)); }