mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 11:26:55 +00:00
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:
parent
7fdeb33595
commit
9c57661f49
@ -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
|
||||||
|
@ -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");
|
||||||
@ -231,8 +231,8 @@ JeeLink_Set($@)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$hexFile = $firmwareFolder . "JeeLink_$detectedFirmware.hex";
|
$hexFile = $firmwareFolder . "JeeLink_$detectedFirmware.hex";
|
||||||
|
|
||||||
|
|
||||||
return "No firmware detected. Please use the firmwareName parameter" if(!$detectedFirmware);
|
return "No firmware detected. Please use the firmwareName parameter" if(!$detectedFirmware);
|
||||||
return "The file '$hexFile' does not exist" if(!-e $hexFile);
|
return "The file '$hexFile' does not exist" if(!-e $hexFile);
|
||||||
|
|
||||||
@ -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
|
||||||
@ -1006,10 +1007,10 @@ sub JeeLink_getIndexOfArray($@) {
|
|||||||
The JeeLink needs the right firmware to be able to receive and deliver the sensor data to fhem. In addition to the way using the
|
The JeeLink needs the right firmware to be able to receive and deliver the sensor data to fhem. In addition to the way using the
|
||||||
arduino IDE to flash the firmware into the JeeLink this provides a way to flash it directly from FHEM.<br><br>
|
arduino IDE to flash the firmware into the JeeLink this provides a way to flash it directly from FHEM.<br><br>
|
||||||
|
|
||||||
The firmwareName argument is optional. If not given, set flash checks the firmware type that is currently installed on the JeeLink and
|
The firmwareName argument is optional. If not given, set flash checks the firmware type that is currently installed on the JeeLink and
|
||||||
updates it with the same type.<br><br>
|
updates it with the same type.<br><br>
|
||||||
|
|
||||||
|
|
||||||
There are some requirements:
|
There are some requirements:
|
||||||
<ul>
|
<ul>
|
||||||
<li>avrdude must be installed on the host<br>
|
<li>avrdude must be installed on the host<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user