[Mono-list] SerialPortTest
Orfeo
orfeo.davia at gmail.com
Wed Mar 4 02:40:25 EST 2009
sojan wrote:
>
> I got a sample code for serial port communication.
> i compiled the code using gmcs Serialport.cs
>
> when i execute the exe as mono Serialport.exe
>
> getting the following exception
>
> Unhandled Exception: System.IO.IOException: I/O Error
> at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32
> baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean
> dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout,
> Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize) [0x00000]
> at (wrapper remoting-invoke-with-check)
> System.IO.Ports.SerialPortStream:.ctor
> (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
> at System.IO.Ports.SerialPort.Open () [0x00000]
> at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open
> ()
> at SerialPortTest.Test () [0x00000]
> at SerialPortTest.Main (System.String[] args) [0x00000]
>
> help me to solve this
> thanks in advance
>
How did you open the port?
In linux you must use "/dev/ttyS0" as port name:
-----
System.IO.Ports.SerialPort serialport = new
System.IO.Ports.SerialPort("/dev/ttyS0",
br,
System.IO.Ports.Parity.None,
8,
System.IO.Ports.StopBits.One);
------
--
View this message in context: http://www.nabble.com/SerialPortTest-tp22324797p22325048.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list