Hi!
I read from emulated serial port (whit usb).It works correctly but with the condition of waitcommevent doesnt. How can use correct the serial events?
Thanks!
I read from emulated serial port (whit usb).It works correctly but with the condition of waitcommevent doesnt. How can use correct the serial events?
Code:
use Win32;
use Win32API::CommPort;
use Win32API::File;
$PortObj= new Win32API::CommPort ('com4')
|| die "Can't open PortName: $^E\n";
while(1)
{
if ( ($PortObj->WaitCommEvent('com4', EV_RXCHAR , )) )
{
$count_in=$PortObj->read_bg( 1);
( $done, $count_in, $string_in) = $PortObj->read_done(1);
print("$string_in\n");
}
}
Comment