VixenModules.Controller.OpenDMX.FTDI.start C# (CSharp) Method

start() public method

public start ( ) : void
return void
        public void start()
        {
            handle = 0;
            status = FT_Open(0, ref handle);
            if (status != FT_STATUS.FT_OK)
            {
                string message = "Failed to open FTDI device" + status.ToString();
                //failure
                throw new Exception(message);
            }
            else
            {
                //worked

                //Configure the device for DMX data
                initOpenDMX();

                //Initialize the universe and start code to all 0s
                for (int i = 0; i < 513; i++)
                    setDmxValue(i, 0);

                //Create and start the thread that sends the output data to the driver
                Thread thread = new Thread(new ThreadStart(writeData));
                thread.Start();
            }
        }

Usage Example

 public override void Start()
 {
     base.Start();
     //Open up FTDI interface
     _dmxPort.start();
 }