예제 #1
0
        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();
            }
        }
예제 #2
0
파일: FTD2XX.cs 프로젝트: qcyb/FlyingDMX
        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();
        }
예제 #3
0
 static void APP_CHECK_STATUS(FT_STATUS status)
 {
     if (status != FT_STATUS.FT_OK)
     {
         Console.WriteLine("Error: {0}", status.ToString());
     }
 }
예제 #4
0
        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");
        }
예제 #5
0
        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");
        }
예제 #6
0
파일: FTDI.cs 프로젝트: stewmc/vixen
		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();
			}
		}
예제 #7
0
 public DMXException(FT_STATUS status)
     : base(status.ToString() + ": " + FTErrors[(int)status])
 {
 }
예제 #8
0
 //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
     }
 }