mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Switch for Windows to use Win32::Serialport instead of Device::Serialport
git-svn-id: https://svn.fhem.de/fhem/trunk@181 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a0e389bdec
commit
755d76baa9
@ -4,7 +4,7 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
use Device::SerialPort;
|
||||
|
||||
|
||||
sub FHZ_Write($$$);
|
||||
sub FHZ_Read($);
|
||||
@ -222,9 +222,15 @@ FHZ_Define($$)
|
||||
$attr{$name}{dummy} = 1;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
Log 3, "FHZ opening FHZ device $dev";
|
||||
my $po = new Device::SerialPort ($dev);
|
||||
if ($^O=~/Win/) {
|
||||
eval ("use Win32::SerialPort;");
|
||||
my $po = new Win32::SerialPort ($dev);
|
||||
}else{
|
||||
eval ("use Device::SerialPort;");
|
||||
my $po = new Device::SerialPort ($dev);
|
||||
}
|
||||
return "Can't open $dev: $!\n" if(!$po);
|
||||
Log 3, "FHZ opened FHZ device $dev";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user