Beispiel #1
0
        /// <summary> Called to create a DataSmResp object </summary>
        /// <param name="defaultEncoding"></param>
        /// <param name="buf"></param>
        /// <param name="offset"></param>
        /// <returns> DataSmResp </returns>
        public static DataSmResp Create(DataCodings defaultEncoding, SmppBuffer buf, ref int offset)
        {
            DataSmResp dataSmResp = new DataSmResp(defaultEncoding);

            try
            {
                int start_offset = offset;

                buf.ExtractHeader(dataSmResp, ref offset);

                if (dataSmResp.Length > Header.HEADER_LENGTH)
                {
                    dataSmResp.MessageId = buf.ExtractCString(ref offset);

                    while (offset - start_offset < dataSmResp.Length)
                    {
                        dataSmResp.Optional.Add(buf.ExtractTLV(ref offset));
                    }
                }
            }

            catch
            {
                dataSmResp = null;
            }

            return(dataSmResp);
        }
Beispiel #2
0
        /// <summary> Called to create a DataSmResp object </summary>
        /// <param name="defaultEncoding"></param>
        /// <param name="buf"></param>
        /// <param name="offset"></param>
        /// <returns> DataSmResp </returns>
        public static DataSmResp Create(DataCodings defaultEncoding, SmppBuffer buf, ref int offset)
        {
            DataSmResp dataSmResp = new DataSmResp(defaultEncoding);

            try
            {
                int start_offset = offset;

                buf.ExtractHeader(dataSmResp, ref offset);

                if (dataSmResp.Length > Header.HEADER_LENGTH)
                {
                    dataSmResp.MessageId = buf.ExtractCString(ref offset);

                    while (offset - start_offset < dataSmResp.Length)
                    {
                        dataSmResp.Optional.Add(buf.ExtractTLV(ref offset));
                    }
                }
            }

            catch
            {
                dataSmResp = null;
            }

            return dataSmResp;
        }
Beispiel #3
0
        /// <summary> Called to fire the data response pdu event </summary>
        /// <param name="data"></param>
        internal void OnDataSmResp(DataSmResp data)
        {
            try
            {
                if (DataSmRespEvent != null)
                {
                    DataSmRespEvent(this, data);
                }
            }

            catch
            {
            }
        }