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(); } }
public override void Start() { try { var ports = SerialPort.GetPortNames(); foreach (string port in ports) { SerialPort sPort = new SerialPort(port); sPort.Open(); sPort.Close(); sPort.Dispose(); } } catch { } handle = 0; status = FT_Open(0, ref handle); Console.WriteLine("[DRIVER STATUS] " + status.ToString()); InitOpenDMX(); done = false; workThread = new Thread(new ThreadStart(writeData)); workThread.Start(); }
static void APP_CHECK_STATUS(FT_STATUS status) { if (status != FT_STATUS.FT_OK) { Console.WriteLine("Error: {0}", status.ToString()); } }
public void Initialize() { Console.WriteLine(">>Initialize"); #if LINUXBUILD FT_STATUS ftstatus = FT_SetVIDPID(0x0403, 0x7cb0); Console.WriteLine("FT_STATUS = {0}", ftstatus.ToString()); #endif Console.WriteLine("<<Initialize"); }
public void ListDevices() { Console.WriteLine(">>ListDevices"); UInt32 arg1 = 99; UInt32 arg2 = 98; UInt32 flags = 0x80000000; FT_STATUS ftstatus = FT_ListDevices(ref arg1, ref arg2, flags); // if(ftstatus == FT_STATUS.FT_OK) Console.WriteLine("FT_STATUS = {0}", ftstatus.ToString()); Console.WriteLine("arg1 = {0}, arg2 = {1}", arg1, arg2); Console.WriteLine("<<ListDevices"); }
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(); } }
public DMXException(FT_STATUS status) : base(status.ToString() + ": " + FTErrors[(int)status]) { }
//modified removing static 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 setDmxValue(0, 0); //Set DMX Start Code } }