mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 12:58:13 +00:00
47_OBIS: Corrected buffer-glitch
git-svn-id: https://svn.fhem.de/fhem/trunk@11029 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7ac4b269d6
commit
d8212e1df8
@ -165,17 +165,16 @@ sub OBIS_Parse($$)
|
|||||||
my $rmsg="";
|
my $rmsg="";
|
||||||
$rmsg = substr($hash->{helper}{BUFFER}, 0, index($hash->{helper}{BUFFER},chr(13).chr(10)));
|
$rmsg = substr($hash->{helper}{BUFFER}, 0, index($hash->{helper}{BUFFER},chr(13).chr(10)));
|
||||||
Log3 $hash,5,"OBIS ($name) - Msg-Parse: $rmsg";
|
Log3 $hash,5,"OBIS ($name) - Msg-Parse: $rmsg";
|
||||||
|
if($rmsg=~/\/.*|\d-\d{1,3}:\d{1,3}.\d{1,3}.\d{1,3}\*\d{1,3}\(.*?\)|!/) {
|
||||||
if($rmsg=~/^([23456789]+)-.*/) {
|
if($rmsg=~/^([23456789]+)-.*/) {
|
||||||
Log3 $hash,3,"OBIS ($name) - Unknown OBIS-Message, please report: $rmsg";
|
Log3 $hash,3,"OBIS ($name) - Unknown OBIS-Message, please report: $rmsg";
|
||||||
}
|
}
|
||||||
|
# End of Message
|
||||||
# End of Message
|
|
||||||
if ($rmsg=~/!.*/) {
|
if ($rmsg=~/!.*/) {
|
||||||
$hash->{helper}{EoM}+=1 if ($hash->{helper}{DEVICES}[1]>0);
|
$hash->{helper}{EoM}+=1 if ($hash->{helper}{DEVICES}[1]>0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#Version
|
#Version
|
||||||
if ($rmsg=~ /.*\/(.*)/) {
|
if ($rmsg=~ /.*\/(.*)/) {
|
||||||
DevIo_SimpleWrite($hash,$hash->{helper}{DEVICES}[2],undef) if (!$hash->{helper}{DEVICES}[2] eq "");
|
DevIo_SimpleWrite($hash,$hash->{helper}{DEVICES}[2],undef) if (!$hash->{helper}{DEVICES}[2] eq "");
|
||||||
if (ReadingsVal($name,"Version","") ne $1) {readingsBulkUpdate($hash, "Version" ,$1); }
|
if (ReadingsVal($name,"Version","") ne $1) {readingsBulkUpdate($hash, "Version" ,$1); }
|
||||||
@ -207,9 +206,9 @@ sub OBIS_Parse($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$hash->{helper}{BUFFER} = substr($hash->{helper}{BUFFER}, index($hash->{helper}{BUFFER},chr(13).chr(10))+2);;
|
$hash->{helper}{BUFFER} = substr($hash->{helper}{BUFFER}, index($hash->{helper}{BUFFER},chr(13).chr(10))+2);;
|
||||||
# $hash->{helper}{BUFFER} =~ s/^.*\r\n(.*)/$1/g;
|
if($hash->{helper}{EoM}==1) { last;}
|
||||||
# Log 3,"Buffer is now: $hash->{helper}{BUFFER}";
|
|
||||||
}
|
}
|
||||||
readingsEndUpdate($hash,1);
|
readingsEndUpdate($hash,1);
|
||||||
# Log 3,"Size of Buffer: ".length($hash->{helper}{BUFFER});
|
# Log 3,"Size of Buffer: ".length($hash->{helper}{BUFFER});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user