mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
44_S7: S5 fix for checking serial port support in win environment
git-svn-id: https://svn.fhem.de/fhem/trunk@14939 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d002092b56
commit
dccc7c40aa
@ -9,14 +9,6 @@ use AutoLoader;
|
||||
|
||||
require "44_S7_Client.pm";
|
||||
|
||||
#if ( OS_Linux() ) {
|
||||
use Device::SerialPort;
|
||||
|
||||
#}
|
||||
#else {
|
||||
# use Win32::SerialPort;
|
||||
#}
|
||||
|
||||
package S5Client;
|
||||
|
||||
#use S7ClientBase;
|
||||
@ -485,13 +477,14 @@ sub S5ConnectPLCAS511($$) {
|
||||
my $b1 = "";
|
||||
my $ttyPort;
|
||||
|
||||
#if ( OS_Linux() ) {
|
||||
$self->{serial} = new Device::SerialPort($portName);
|
||||
if ($^O=~/Win/) {
|
||||
eval ("use Win32::SerialPort;");
|
||||
$self->{serial} = new Win32::SerialPort ($portName);
|
||||
}else{
|
||||
eval ("use Device::SerialPort;");
|
||||
$self->{serial} = new Device::SerialPort ($portName);
|
||||
}
|
||||
|
||||
#}
|
||||
#else {
|
||||
# $ttyPort = new Win32::SerialPort( $portName );
|
||||
#}
|
||||
|
||||
main::Log3( undef, 3, "Can't open serial port $portName" )
|
||||
unless ( $self->{serial} );
|
||||
|
Loading…
Reference in New Issue
Block a user