Multi-IODev XXX_MSGCNT bug fixed

git-svn-id: https://svn.fhem.de/fhem/trunk@481 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2009-11-20 11:10:07 +00:00
parent e07824ec60
commit b68790f22f
2 changed files with 14 additions and 5 deletions

View File

@@ -1,7 +1,4 @@
############################################## ##############################################
# - Please call sunrise_coord before using this module, else you'll get times
# for frankfurt am main (germany). See the "at" entry in commandref.html
#
# This code is derived from DateTime::Event::Sunrise, version 0.0501. # This code is derived from DateTime::Event::Sunrise, version 0.0501.
# Simplified and removed further package # dependency (DateTime, # Simplified and removed further package # dependency (DateTime,
# Params::Validate, etc). For comments see the original code. # Params::Validate, etc). For comments see the original code.

View File

@@ -155,7 +155,7 @@ my $nextat; # Time when next timer will be triggered.
my $intAtCnt=0; my $intAtCnt=0;
my %duplicate; # Pool of received msg for multi-fhz/cul setups my %duplicate; # Pool of received msg for multi-fhz/cul setups
my $duplidx=0; # helper for the above pool my $duplidx=0; # helper for the above pool
my $cvsid = '$Id: fhem.pl,v 1.83 2009-11-14 09:20:37 rudolfkoenig Exp $'; my $cvsid = '$Id: fhem.pl,v 1.84 2009-11-20 11:10:07 rudolfkoenig Exp $';
my $namedef = my $namedef =
"where <name> is either:\n" . "where <name> is either:\n" .
"- a single device name\n" . "- a single device name\n" .
@@ -2046,7 +2046,18 @@ Dispatch($$$)
Log 5, "$name dispatch $dmsg"; Log 5, "$name dispatch $dmsg";
my ($isdup, $idx) = CheckDuplicate($name, $dmsg); my ($isdup, $idx) = CheckDuplicate($name, $dmsg);
return $duplicate{$idx}{FND} if($isdup); if($isdup) {
my $found = $duplicate{$idx}{FND};
foreach my $found (@{$found}) {
if($addvals) {
foreach my $av (keys %{$addvals}) {
$defs{$found}{"${name}_$av"} = $addvals->{$av};
}
}
$defs{$found}{"${name}_MSGCNT"}++;
}
return $duplicate{$idx}{FND};
}
my @found; my @found;
my $last_module; my $last_module;
@@ -2094,6 +2105,7 @@ Dispatch($$$)
return undef; return undef;
} else { } else {
if($defs{$found}) { if($defs{$found}) {
$defs{$found}{MSGCNT}++;
if($addvals) { if($addvals) {
foreach my $av (keys %{$addvals}) { foreach my $av (keys %{$addvals}) {
$defs{$found}{"${name}_$av"} = $addvals->{$av}; $defs{$found}{"${name}_$av"} = $addvals->{$av};