Problems? Is your data what you think it is? | |
PerlMonks |
Destroying tied serial portby Marais (Novice) |
on Dec 23, 2012 at 21:31 UTC ( [id://1010128]=perlquestion: print w/replies, xml ) | Need Help?? |
Marais has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, Perl monks:
I'm developing an application which communicates with an Arduino via USB. It runs in a POE environment. I use the Device::SerialPort module to talk to the USB port (as a file). At times I want to close the connection (when certain errors occur) and re-open it. So far, closing the connection is not working for me. Here's how I open it:
By passing $handle to a POE ReadWrite wheel, I can communicate perfectly with the Arduino. I use the following code to try to close the connection, prior to re-opening it:
and this results in the error message:
I have to admit that I don't understand what the "gensym" and "tie" stuff is all about; I'm just following the examples in the documentation, so it's almost certainly due to my ignorance. Can anyone explain how to properly close this port?
Back to
Seekers of Perl Wisdom
|
|