Mono 2.6.3 MonoDevelop 2.2 openSUSE 11.2
I'm trying to read from a CP2102 USB device. The program works when running in Windows but not when on Linux. The comport.DataReceived event does not fire.
I'm using /dev/ttyUSB0 as the comport.portName value which is the only ttyUSB value that shows up in my dir list. Is that the correct value to be using?
crw-rw---- 1 root dialout 188, 0 2010-04-10 11:45 ttyUSB0
Bus 004 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device
I looked in yast's hardware information and under USB it shows the CP2102 (/dev/ttyUSB0), Drivers Active:Yes so I assume the drivers are in place. Here's the code I'm using:
comport = new SerialPort();
comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
comport.BaudRate = 128000;
comport.DataBits = 8;
comport.StopBits = StopBits.One;
comport.Parity = Parity.None;
comport.Handshake = Handshake.None;
comport.ReadTimeout = 500;
comport.WriteTimeout = 500;
comport.PortName = "/dev/ttyUSB0";
comport.DtrEnable = true;
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
getPortData(); // Never gets fired
Can anyone tell me what might be stopping the DataReceived event from firing?