mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-17 17:36:01 +00:00
OWMULTI_BinValues: process only calles with expected readdata
git-svn-id: https://svn.fhem.de/fhem/trunk@5436 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6001be2023
commit
0bdc14908b
@ -747,17 +747,24 @@ sub OWXMULTI_BinValues($$$$$$$$) {
|
||||
my ($hash, $context, $success, $reset, $owx_dev, $command, $numread, $res) = @_;
|
||||
|
||||
#-- always check for success, unused are reset, numread
|
||||
return unless ($success and $context);
|
||||
return unless ($success and $context =~ /^ds2438.getv[ad]d$/);
|
||||
|
||||
#Log 1,"OWXMULTI_BinValues context = $context";
|
||||
|
||||
#-- process results
|
||||
my @data=split(//,$res);
|
||||
Log 1, "invalid data length, ".int(@data)." instead of 9 bytes"
|
||||
if (@data != 9);
|
||||
Log 1, "conversion not complete or data invalid"
|
||||
if ((ord($data[0]) & 112)!=0);
|
||||
Log 1, "invalid CRC"
|
||||
if (OWX_CRC8(substr($res,0,8),$data[8])==0);
|
||||
if (@data != 9) {
|
||||
Log 1, "invalid data length, ".int(@data)." instead of 9 bytes";
|
||||
return;
|
||||
}
|
||||
if ((ord($data[0]) & 112)!=0) {
|
||||
Log 1, "conversion not complete or data invalid";
|
||||
return;
|
||||
}
|
||||
if (OWX_CRC8(substr($res,0,8),$data[8])==0) {
|
||||
Log 1, "invalid CRC";
|
||||
return;
|
||||
}
|
||||
|
||||
#-- this must be different for the different device types
|
||||
# family = 26 => DS2438
|
||||
|
Loading…
x
Reference in New Issue
Block a user