in reply to Re^4: Win32 Serial Read input from device
in thread Win32 Serial Read input from device
I see, I didn't expect that Time::HiRes was going to vary between platforms. It was just a toy thing anyway. Just remove the "use Time::HiRes" line, and change the setup_serial_interface subroutine to:
sub setup_serial_interface { #my $seconds_per_transmission = 0.567; my $seconds_per_transmission = 1; $SIG{ALRM} = sub { push @serial_data, rand; alarm $seconds_per_transmission; }; # First packet of data should occur in a couple seconds #alarm 2.5; alarm 3; }
and it should work just fine for you. (I just made those changes to my local copy and tried it out, it still works here, and shouldn't give you the error you reported.)
The Time::HiRes was included simply so I could use fractional seconds for the alerts, it wasn't really important.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Win32 Serial Read input from device
by PilotinControl (Pilgrim) on Mar 29, 2018 at 19:46 UTC |