Serialport in Mono in Linux Not Responding to Datareceived Event

SerialPort in mono in linux not responding to DataReceived event

mono does not support Event for serialport.

It is shown on mono's website

.NET SerialPort DataReceived event not firing

I can only surmise that the problem was indeed with the Virtual Serial Port Emulator program. this is NOT to say there is a problem with that software: VSPE has worked very well for me so far. But there was some conflict between my code and how I had set up the VSPE connector.

DataReceived event sometimes doesn't fire

It turned out that it was a hardware problem.

The connection betwen devices looks like this:
Device <> RS-485 <> Converter1 <> LAN <> Converter2 <> RS-232 <> Computer <> virtual COM

Converter1 appears to be malfunctioning, it clusters and holds the data my device sends to it. Now I know what is wrong I can let competent people take care of it :)

Thanks @Matthew Rodatus for your help. Your answer in roundabout way guided me to check what exactly and when exactly is coming to my COM.

In C#, does the DataReceived event handler of the SerialPort class execute on it's own thread?

MSDN says:

The DataReceived event is raised on a secondary thread when data is
received from the SerialPort object. Because this event is raised on a
secondary thread, and not the main thread, attempting to modify some
elements in the main thread, such as UI elements, could raise a
threading exception. If it is necessary to modify elements in the main
Form or Control, post change requests back using Invoke, which will do
the work on the proper thread.

So yes.

SerialPort.DataReceived



Related Topics



Leave a reply



Submit