示例#1
0
        /// <summary> Called to create a CancelSm object </summary>
        /// <param name="defaultEncoding"></param>
        /// <param name="buf"></param>
        /// <param name="offset"></param>
        /// <returns> CancelSm </returns>
        internal static CancelSm Create(DataCodings defaultEncoding,
                                        SmppBuffer buf,
                                        ref int offset)
        {
            var cancelSm = new CancelSm(defaultEncoding);

            try
            {
                buf.ExtractHeader(cancelSm,
                                  ref offset);

                cancelSm.ServiceType = buf.ExtractCString(ref offset);
                cancelSm.MessageId   = buf.ExtractCString(ref offset);
                cancelSm.SourceTon   = buf.ExtractByte(ref offset);
                cancelSm.SourceNpi   = buf.ExtractByte(ref offset);
                cancelSm.SourceAddr  = buf.ExtractCString(ref offset);
                cancelSm.DestTon     = buf.ExtractByte(ref offset);
                cancelSm.DestNpi     = buf.ExtractByte(ref offset);
                cancelSm.DestAddr    = buf.ExtractCString(ref offset);
            }

            catch { cancelSm = null; }

            return(cancelSm);
        }
示例#2
0
 /// <summary> Called to create a CancelSmResp object </summary>
 /// <param name="defaultEncoding"></param>
 /// <param name="cancelSm"></param>
 /// <param name="status"></param>
 /// <returns> CancelSmResp </returns>
 public static CancelSmResp Create(DataCodings defaultEncoding,
                                   CancelSm cancelSm,
                                   CommandStatus status)
 {
     return(new CancelSmResp(defaultEncoding,
                             status,
                             cancelSm.Sequence));
 }