/// <summary>
        ///     Create a new base validator
        /// </summary>
        /// <param name="config">Configuration to use</param>
        protected BaseValidator(Rs232Config config)
        {
            Config         = config ?? throw new ArgumentNullException(nameof(config));
            SerialProvider = config.SerialProvider;

            // All services will use this logger instance
            Config.Logger ??= new NullLogger();
            SerialProvider.Logger = Config.Logger;
            Logger = Config.Logger;

            // Wait for this many polls before saying the acceptor is online
            _deviceIsReady = new CounterEvent(2);

            Logger?.Info("{0} Created new validator: {1}", GetType().Name, config);
        }
示例#2
0
 /// <summary>
 ///     Create a new Apex RS232 validator.
 ///     You must be using the RS232 Tx and Tx on the 18 pin IO.
 ///     You must have the acceptor configured for RS232 mode.
 /// </summary>
 /// <param name="config">Configuration options</param>
 public ApexValidator(Rs232Config config) : base(config)
 {
     _apexState = new ApexState();
 }