From: Bill S. <bs...@vi...> - 2000-05-16 20:30:29
|
Hi All, Attached is the current status of my MH interface to the Compool pool equipment. There still is some work to be done, but you can get/set time, get/set temperature, and get/set equipment states. There is also _now versions of the commands where possible. The test_compool.pl contains some basic functional testing. There are a few things that I need to finish (such as supporting some of the other models than mine, some have different number of aux ports and such). Also, once I learn perl a bit better, seems this likely should become a class instead of a package of related functions. There is one serious problem, however, and I am hoping someone here can help. The line that I am pulling the data in from seems very noisy, I get allot of break_signals and framing_errors reported by the comport. I see some data underruns and overruns. I've parsed the stream to account for this (the actual data is checksummed so I know if I got it ok). However, I am doing this via: my $data, my $serial_port = $Serial_Ports{Compool}{object}; $serial_port->reset_error; if ($data = $serial_port->input) { ... } $serial_port->reset_error; This code will run for some period of time (minutes to hours) but eventually it will hang on the $serial_port->input. I *think* that internally input is getting the number of characters expected from the port, and then waiting for that number. One of the underflows I see must happen in this case causing input to never complete. What can I do here to add some sort of timeout or better input handling from the port? The port is 9600/8/n/1 and I am receiving about 25 characters in a packet (there is usually 2.5 seconds between packets unless a user manually activates something via a physical controller). So I timeout of (max) 100ms from the last character received should be plenty, anyway to do this? Bill |