34_panStamp.pm, 36_JeeLink.pm: allow host:port as device for usage with ser2net

git-svn-id: https://svn.fhem.de/fhem/trunk@8599 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-05-18 16:56:10 +00:00
parent 7fdeb33595
commit 9c57661f49
2 changed files with 11 additions and 9 deletions

View File

@ -61,7 +61,7 @@ panStamp_Define($$)
if(@a < 3 || @a > 6) { if(@a < 3 || @a > 6) {
my $msg = "wrong syntax: define <name> panStamp {none | devicename[\@baudrate] ". my $msg = "wrong syntax: define <name> panStamp {none | devicename[\@baudrate] ".
"| devicename\@directio} [<address> [<channel> [<syncword>]]]"; "| devicename\@directio | hostname:port} [<address> [<channel> [<syncword>]]]";
Log3 undef, 2, $msg; Log3 undef, 2, $msg;
return $msg; return $msg;
} }
@ -91,7 +91,7 @@ panStamp_Define($$)
$attr{$name}{dummy} = 1; $attr{$name}{dummy} = 1;
return undef; return undef;
} }
$dev .= "\@38400" if( $dev !~ m/\@/ ); $dev .= "\@38400" if( $dev !~ m/\@/ && $dev !~ m/:/ );
$hash->{address} = uc($address); $hash->{address} = uc($address);
$hash->{channel} = uc($channel); $hash->{channel} = uc($channel);
@ -518,6 +518,7 @@ panStamp_SimpleWrite(@)
$msg .= "\r" unless($nocr); $msg .= "\r" unless($nocr);
$hash->{USBDev}->write($msg) if($hash->{USBDev}); $hash->{USBDev}->write($msg) if($hash->{USBDev});
syswrite($hash->{TCPDev}, $msg) if($hash->{TCPDev});
syswrite($hash->{DIODev}, $msg) if($hash->{DIODev}); syswrite($hash->{DIODev}, $msg) if($hash->{DIODev});
# Some linux installations are broken with 0.001, T01 returns no answer # Some linux installations are broken with 0.001, T01 returns no answer

View File

@ -102,7 +102,7 @@ JeeLink_Define($$)
if(@a != 3) { if(@a != 3) {
my $msg = "wrong syntax: define <name> JeeLink {none | devicename[\@baudrate] ". my $msg = "wrong syntax: define <name> JeeLink {none | devicename[\@baudrate] ".
"| devicename\@directio}"; "| devicename\@directio | hostname:port}";
Log3 undef, 2, $msg; Log3 undef, 2, $msg;
return $msg; return $msg;
} }
@ -124,7 +124,7 @@ JeeLink_Define($$)
$attr{$name}{dummy} = 1; $attr{$name}{dummy} = 1;
return undef; return undef;
} }
$dev .= "\@57600" if( $dev !~ m/\@/ ); $dev .= "\@57600" if( $dev !~ m/\@/ && $def !~ m/:/ );
$hash->{DeviceName} = $dev; $hash->{DeviceName} = $dev;
my $ret = DevIo_OpenDev($hash, 0, "JeeLink_DoInit"); my $ret = DevIo_OpenDev($hash, 0, "JeeLink_DoInit");
@ -833,6 +833,7 @@ JeeLink_SimpleWrite(@)
$msg .= "\n" unless($nocr); $msg .= "\n" unless($nocr);
$hash->{USBDev}->write($msg) if($hash->{USBDev}); $hash->{USBDev}->write($msg) if($hash->{USBDev});
syswrite($hash->{TCPDev}, $msg) if($hash->{TCPDev});
syswrite($hash->{DIODev}, $msg) if($hash->{DIODev}); syswrite($hash->{DIODev}, $msg) if($hash->{DIODev});
# Some linux installations are broken with 0.001, T01 returns no answer # Some linux installations are broken with 0.001, T01 returns no answer