mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-07-28 22:07:02 -04:00
Merge pull request #936 from ZoneMinder/handle_serial_trigger_problem
add error handling on failure to open serial port
This commit is contained in:
@@ -58,6 +58,12 @@ sub open
|
||||
{
|
||||
my $self = shift;
|
||||
my $device = new Device::SerialPort( $self->{path} );
|
||||
if ( ! $device )
|
||||
{
|
||||
Error( "Unable to open $$self{path}: $!" );
|
||||
$self->{state} = 'closed';
|
||||
return;
|
||||
}
|
||||
$device->baudrate(9600);
|
||||
$device->databits(8);
|
||||
$device->parity('none');
|
||||
|
||||
Reference in New Issue
Block a user