public void ControllerDisabledByDefault()
        {
            var hardwareController = new HardwareController();
            var dynamicSensorController = new DynamicSensorController(
                hardwareController, Assembly.GetAssembly(this.GetType()));

            Assert.AreEqual(false, dynamicSensorController.Enabled);
        }
        public void EnableController()
        {
            var hardwareController = new HardwareController();
            var dynamicSensorController = new DynamicSensorController(
                hardwareController, Assembly.GetAssembly(this.GetType()));

            dynamicSensorController.Enable();

            Assert.AreEqual(true, dynamicSensorController.Enabled);
        }
Example #3
0
        public void EnableDynamicListening(ThreadPriority priority = ThreadPriority.Normal)
        {
            if (this.dynController == null)
            {
                this.dynController = new DynamicSensorController(
                    this.hardwareController, Assembly.GetAssembly(this.GetType()));
            }

            if (this.dsThread == null)
            {
                this.dsThread = new Thread(new ThreadStart(this.dynController.Run));
                this.dsThread.Priority = priority;
                this.dsThread.Start();
            }

            this.dynController.Enable();
        }