/// <summary> Called to create a PduBind object </summary> /// <param name="defaultEncoding"></param> /// <param name="buf"></param> /// <param name="offset"></param> /// <returns> BindSm </returns> public static BindSm Create(DataCodings defaultEncoding, SmppBuffer buf, ref int offset) { var bindSm = new BindSm(defaultEncoding); try { var start_offset = offset; buf.ExtractHeader(bindSm, ref offset); bindSm.SystemId = buf.ExtractCString(ref offset); bindSm.Password = buf.ExtractCString(ref offset); bindSm.SystemType = buf.ExtractCString(ref offset); bindSm.InterfaceVersion = buf.ExtractByte(ref offset); bindSm.AddrTon = buf.ExtractByte(ref offset); bindSm.AddrNpi = buf.ExtractByte(ref offset); bindSm.AddressRange = buf.ExtractCString(ref offset); } catch { bindSm = null; } return(bindSm); }
/// <summary> Called to create a BindSmResp object </summary> /// <param name="defaultEncoding"></param> /// <param name="bindSm"></param> /// <param name="commandSet"></param> /// <param name="commandStatus"></param> /// <param name="systemId"></param> /// <returns> BindSmResp </returns> public static BindSmResp Create(DataCodings defaultEncoding, BindSm bindSm, CommandSet commandSet, CommandStatus commandStatus, string systemId) { return(new BindSmResp(defaultEncoding, commandSet, commandStatus, bindSm.Sequence, systemId)); }