示例#1
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(100);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SystemId)));
                return(builder.ToArray());
            }
示例#2
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(30);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_MessageId)));
                builder.Add(_SourceAddressTon);
                builder.Add(_SourceAddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SourceAddress)));
                return(builder.ToArray());
            }
示例#3
0
 public void SetString(string value)
 {
     if (IsCString(TagId))
     {
         _Value = SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(value));
     }
     else
     {
         _Value = SmppDataCoding.BaseEncoding.GetBytes(value);
     }
 }
示例#4
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(90);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SystemId)));
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_Password)));
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SystemType)));
                builder.Add(_InterfaceVersion);
                builder.Add(_AddressTon);
                builder.Add(_AddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_AddressRange)));
                return(builder.ToArray());
            }
示例#5
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(100);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_ServiceType.Value)));
                builder.Add(_SourceAddressTon);
                builder.Add(_SourceAddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SourceAddress)));
                builder.Add(_DestinationAddressTon);
                builder.Add(_DestinationAddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_DestinationAddress)));
                builder.Add(_EsmClass.Value);
                builder.Add(_RegisteredDelivery.Value);
                builder.Add(_DataCoding.Value);
                return(builder.ToArray());
            }
示例#6
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(30);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_MessageId)));
                if (_FinalDate == null)
                {
                    builder.AddRange(SmppConverter.SmppNullEnd(null));
                }
                else
                {
                    builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_FinalDate.SmppDate)));
                }
                builder.Add(_MessageState);
                builder.Add(_ErrorCode);
                return(builder.ToArray());
            }
示例#7
0
            public byte[] ToByteArray()
            {
                var builder = new ByteBuilder(300);

                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_ServiceType.Value)));
                builder.Add(_SourceAddressTon);
                builder.Add(_SourceAddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_SourceAddress)));
                builder.Add(_DestinationAddressTon);
                builder.Add(_DestinationAddressNpi);
                builder.AddRange(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_DestinationAddress)));
                builder.Add(_EsmClass.Value);
                builder.Add(_ProtocolId);
                builder.Add(_PriorityFlag);
                if (_ScheduleDeliveryTime == null)
                {
                    builder.AddRange(SmppConverter.SmppNullEnd(null));
                }
                else
                {
                    builder.AddRange(
                        SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_ScheduleDeliveryTime.SmppDate)));
                }
                if (_ValidityPeriod == null)
                {
                    builder.AddRange(SmppConverter.SmppNullEnd(null));
                }
                else
                {
                    builder.AddRange(
                        SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_ValidityPeriod.SmppDate)));
                }
                builder.Add(_RegisteredDelivery.Value);
                builder.Add(_ReplaceIfPresent);
                builder.Add(_ShortMessage.DataCoding.Value);
                builder.Add(_SmDefaultMessageId);
                builder.Add(Convert.ToByte(_ShortMessage.Length));
                builder.AddRange(_ShortMessage.Value);
                return(builder.ToArray());
            }
示例#8
0
 public byte[] ToByteArray()
 {
     return(SmppConverter.SmppNullEnd(SmppDataCoding.BaseEncoding.GetBytes(_MessageId)));
 }