コード例 #1
0
        /// <summary>
        /// Constructor for the X10CM11aController object.
        /// </summary>
        /// <param name="houseCode">House Code to control</param>
        /// <param name="comPort">Comm port the CM11a is on</param>
        /// <param name="baudRate">BaudRate of the CM11a </param>
        /// <param name="parity">Parity for serial Communications</param>
        /// <param name="dataBits">Databits for serial Commnunication</param>
        /// <param name="stopBits">Stop bits for serial Communication</param>
        public Cm11LowLevelDriver(String houseCode, string comPort, int baudRate, Parity parity, int dataBits,
                                  StopBits stopBits)
        {
            x10HouseCode = (CM11aHouseCode)Enum.Parse(typeof(CM11aHouseCode), houseCode);
            worker = new Cm11LowLevelDriverWorker(x10HouseCode, comPort, baudRate, parity, dataBits, stopBits);
            worker.Error += new EventHandler<Cm11LowLevelDriverError>(worker_Error);

            try
            {
                workerThread = new System.Threading.Thread(worker.StartProcessing);
                workerThread.IsBackground = true;
                workerThread.Start();
            }
            catch (ApplicationException ae)
            {
                throw (new ApplicationException("Error Initializing CM11 X10 Controller", ae));
            }
        }
コード例 #2
0
        /// <summary>
        /// Constructor for the X10CM11aController object.
        /// </summary>
        /// <param name="houseCode">House Code to control</param>
        /// <param name="comPort">Comm port the CM11a is on</param>
        /// <param name="baudRate">BaudRate of the CM11a </param>
        /// <param name="parity">Parity for serial Communications</param>
        /// <param name="dataBits">Databits for serial Commnunication</param>
        /// <param name="stopBits">Stop bits for serial Communication</param>
        public Cm11LowLevelDriver(String houseCode, string comPort, int baudRate, Parity parity, int dataBits,
                                  StopBits stopBits)
        {
            x10HouseCode  = (CM11aHouseCode)Enum.Parse(typeof(CM11aHouseCode), houseCode);
            worker        = new Cm11LowLevelDriverWorker(x10HouseCode, comPort, baudRate, parity, dataBits, stopBits);
            worker.Error += new EventHandler <Cm11LowLevelDriverError>(worker_Error);

            try
            {
                workerThread = new System.Threading.Thread(worker.StartProcessing);
                workerThread.IsBackground = true;
                workerThread.Start();
            }
            catch (ApplicationException ae)
            {
                throw (new ApplicationException("Error Initializing CM11 X10 Controller", ae));
            }
        }