Clear questions and runnable code
get the best and fastest answer
Threaded RS232 communicationby tobias_hofer (Friar)
|on Jan 30, 2013 at 09:30 UTC||Need Help??|
tobias_hofer has asked for the
wisdom of the Perl Monks concerning the following question:
I am developing a perl module which shall communicate by rs232 with a micro controller. The communication is done by threads and thread::queues.
My problem occurs on shutdown. I am not able to end the read thread as it is blocked by a call to
So I changed to "background read"
Doing this I got nothing in $data so I did a call to
Then I receive the message in the $string_in variable, but the call to read_done is also blocking.
I have read the doc. in the Win32::SerialPort and have come to give a try with the API from Win32API::CommPort.
However, I do not get this API working properly. I did the following:
But the code is breaking and I do not receive an error message.. so I do not know why..
I am quite sure I missuse somehow this ReadFile API..
Any help is very welcome!