/// <summary> /// Constructor /// </summary> /// <param name="connection">The connection on which the keeper will subscribe /// to backdoor messages.</param> public BackdoorKeeper(Safir.Dob.ConnectionBase connection) { if (connection == null) { throw new Dob.Typesystem.SoftwareViolationException("You must pass a valid connection"); } m_connection = connection; }
/// <summary> /// Start reception of trace on/off commands /// <para/> /// The given connection must be opened before this method is called. /// If the connection is closed the reception of backdoor commands is /// stopped. If a new connection is opened this method needs to be called /// in order to start reception of backdoor commands. /// <para/> /// In situations when a connection is regularly closed and reopened, /// for instance in the case of context switches, you should consider /// using a dedicated connection as parameter. /// </summary> /// <param name="connection">The connection used for setting up a subscription for /// backdoor commands.</param> public static void Start(Safir.Dob.ConnectionBase connection) { byte success; Safir.Dob.ConnectionAspectMisc misc = new Safir.Dob.ConnectionAspectMisc(connection); Library.SwreC_StartTraceBackdoor(System.Text.Encoding.UTF8.GetBytes(misc.GetConnectionNameCommonPart() + char.MinValue), System.Text.Encoding.UTF8.GetBytes(misc.GetConnectionNameInstancePart() + char.MinValue), out success); if (!Safir.Dob.Typesystem.Internal.InternalOperations.BoolOf(success)) { Safir.Dob.Typesystem.LibraryExceptions.Instance.Throw(); } }