Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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.AddFinalLength();

            return(tmpBuff.Buffer);
        }
Exemplo n.º 4
0
        /// <summary> Called to return the PDU for this type of object </summary>
        /// <returns> byte[] </returns>
        byte[] IPacket.GetPDU()
        {
            // Create buffer and add header information
            SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding, this);

            // Insert final length
            tmpBuff.AddFinalLength();

            // Return byte array
            return(tmpBuff.Buffer);
        }
Exemplo n.º 5
0
        /// <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);
        }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
0
        /// <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);
        }
Exemplo n.º 9
0
        /// <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);
        }