mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
00_SIGNALduino.pm: Fixed perl warnings and crash
git-svn-id: https://svn.fhem.de/fhem/trunk@16531 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
efd05196ec
commit
899fd848e3
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 00_SIGNALduino: Perl Warnings and FHEM crash fixed
|
||||||
- added: 88_xs1Bridge: Documentation added
|
- added: 88_xs1Bridge: Documentation added
|
||||||
- added: 88_xs1Dev: various sensor types added
|
- added: 88_xs1Dev: various sensor types added
|
||||||
- feature: 57_Calendar: get ... vevents and much more (forum #86148)
|
- feature: 57_Calendar: get ... vevents and much more (forum #86148)
|
||||||
|
@ -48,6 +48,7 @@ sub SIGNALduino_Read($);
|
|||||||
sub SIGNALduino_Ready($);
|
sub SIGNALduino_Ready($);
|
||||||
sub SIGNALduino_Write($$$);
|
sub SIGNALduino_Write($$$);
|
||||||
sub SIGNALduino_SimpleWrite(@);
|
sub SIGNALduino_SimpleWrite(@);
|
||||||
|
sub SIGNALduino_Log3($$$);
|
||||||
|
|
||||||
#my $debug=0;
|
#my $debug=0;
|
||||||
|
|
||||||
@ -4112,7 +4113,11 @@ sub SIGNALduino_callsub
|
|||||||
|
|
||||||
my ($rcode, @returnvalues) = $method->($name, @args) ;
|
my ($rcode, @returnvalues) = $method->($name, @args) ;
|
||||||
|
|
||||||
Log3 $name, 5, "$name: modified value after $funcname: @returnvalues";
|
if (@returnvalues && defined($returnvalues[0])) {
|
||||||
|
SIGNALduino_Log3 $name, 5, "$name: rcode=$rcode, modified value after $funcname: @returnvalues";
|
||||||
|
} else {
|
||||||
|
SIGNALduino_Log3 $name, 5, "$name: rcode=$rcode, after calling $funcname";
|
||||||
|
}
|
||||||
return ($rcode, @returnvalues);
|
return ($rcode, @returnvalues);
|
||||||
} elsif (defined $method ) {
|
} elsif (defined $method ) {
|
||||||
Log3 $name, 5, "$name: Error: Unknown method $funcname Please check definition";
|
Log3 $name, 5, "$name: Error: Unknown method $funcname Please check definition";
|
||||||
@ -4436,7 +4441,7 @@ sub SIGNALduino_postDemo_WS2000($@) {
|
|||||||
do {
|
do {
|
||||||
$error += !$bit_msg[$index + $datastart]; # jedes 5. Bit muss 1 sein
|
$error += !$bit_msg[$index + $datastart]; # jedes 5. Bit muss 1 sein
|
||||||
$dataindex = $index + $datastart + 1;
|
$dataindex = $index + $datastart + 1;
|
||||||
$data = oct( "0b".(join "", reverse @bit_msg[$dataindex .. $dataindex + 3]));
|
$data = oct( "0b".(join "", reverse @bit_msg[$dataindex .. $dataindex + 3])) if ($dataindex <= $datalength);
|
||||||
if ($index == 5) {$adr = ($data & 0x07)} # Sensoradresse
|
if ($index == 5) {$adr = ($data & 0x07)} # Sensoradresse
|
||||||
if ($datalength == 45 || $datalength == 46) { # Typ 1 ohne Summe
|
if ($datalength == 45 || $datalength == 46) { # Typ 1 ohne Summe
|
||||||
if ($index <= $datalength - 5) {
|
if ($index <= $datalength - 5) {
|
||||||
@ -4459,7 +4464,7 @@ sub SIGNALduino_postDemo_WS2000($@) {
|
|||||||
return (0, undef);
|
return (0, undef);
|
||||||
} else {
|
} else {
|
||||||
if ($datalength < 45 || $datalength > 46) { # Summe prüfen, außer Typ 1 ohne Summe
|
if ($datalength < 45 || $datalength > 46) { # Summe prüfen, außer Typ 1 ohne Summe
|
||||||
$data = oct( "0b".(join "", reverse @bit_msg[$dataindex .. $dataindex + 3]));
|
$data = oct( "0b".(join "", reverse @bit_msg[$dataindex .. $dataindex + 3])) if ($dataindex <= $datalength);
|
||||||
if ($data != ($sum & 0x0F)) {
|
if ($data != ($sum & 0x0F)) {
|
||||||
Log3 $name, 4, "$name: WS2000 Sensortyp $typ Adr $adr - ERROR sum";
|
Log3 $name, 4, "$name: WS2000 Sensortyp $typ Adr $adr - ERROR sum";
|
||||||
return (0, undef);
|
return (0, undef);
|
||||||
@ -5135,6 +5140,16 @@ sub SIGNALduino_compPattern($$$%)
|
|||||||
#$patternListRaw = \%buckets;
|
#$patternListRaw = \%buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################
|
||||||
|
# the new Log with integrated loglevel checking
|
||||||
|
sub SIGNALduino_Log3($$$)
|
||||||
|
{
|
||||||
|
|
||||||
|
my ($dev, $loglevel, $text) = @_;
|
||||||
|
|
||||||
|
return Log3($dev,$loglevel,$text);
|
||||||
|
}
|
||||||
|
|
||||||
#print Dumper (%msg_parts);
|
#print Dumper (%msg_parts);
|
||||||
#print "\n";
|
#print "\n";
|
||||||
#SIGNALduino_filterSign(%msg_parts);
|
#SIGNALduino_filterSign(%msg_parts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user