Exemplo n.º 1
0
        public SerialPortCDC(USBC_CDC port, int writeBufferSize, int readBufferSize)
            : base(writeBufferSize, readBufferSize)
        {
            // TODO Check somewhere USBClientController.GetState() == USBClientController.State.Running

            this.port = port;

            ReadTimeout     = 33;
            AfterWriteDelay = 0;
        }
Exemplo n.º 2
0
        public static void Main()
        {
            cdc = USBClientController.StandardDevices.StartCDC_WithDebugging();

            UART = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
            UART.Open();
            UART.Flush();
            UART.DataReceived += new SerialDataReceivedEventHandler(UART_DataReceived);
            if (USBClientController.GetState() != USBClientController.State.Running)
            {
                Debug.Print("Waiting to connect to PC...");
            }
            else
            {
                while (true)
                {
                    UART.Flush();
                    Thread.Sleep(1000);
                }
            }
        }
Exemplo n.º 3
0
 public SerialPortCDC(USBC_CDC port) : this(port, 0, 1)
 {
 }
Exemplo n.º 4
0
 public USBCDCDevice()
 {
     cdc = USBClientController.StandardDevices.StartCDC();
 }
Exemplo n.º 5
0
 public USBCDCDevice()
 {
     cdc = USBClientController.StandardDevices.StartCDC();
 }