mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
00_HMUARTLGW.pm: improve timing compatibility with CUL (noansi)
Patch from noansi, forum #122160 git-svn-id: https://svn.fhem.de/fhem/trunk@25153 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fe03805d3d
commit
c17f64af1f
@ -1,5 +1,6 @@
|
|||||||
##############################################
|
##############################################
|
||||||
# $Id$
|
# $Id$
|
||||||
|
# noansi: modified for better timing compatibility with CUL
|
||||||
#
|
#
|
||||||
# HMUARTLGW provides support for the eQ-3 HomeMatic Wireless LAN Gateway
|
# HMUARTLGW provides support for the eQ-3 HomeMatic Wireless LAN Gateway
|
||||||
# (HM-LGW-O-TW-W-EU) and the eQ-3 HomeMatic UART module (HM-MOD-UART), which
|
# (HM-LGW-O-TW-W-EU) and the eQ-3 HomeMatic UART module (HM-MOD-UART), which
|
||||||
@ -1447,17 +1448,24 @@ sub HMUARTLGW_Parse($$$$)
|
|||||||
|
|
||||||
Log3($hash, 5, "HMUARTLGW ${name} Dispatch: ${dmsg}");
|
Log3($hash, 5, "HMUARTLGW ${name} Dispatch: ${dmsg}");
|
||||||
|
|
||||||
my $wait = 0;
|
if ($modules{CUL_HM}{defptr}{$src}) {
|
||||||
if (!(hex($flags) & (1 << 5))) {
|
my $flgh = hex($flags);
|
||||||
#!BIDI
|
my $wait = 0.100;
|
||||||
$wait = 0.100;
|
$wait += 0.200 if ($flgh & (1 << 5) && # BIDI
|
||||||
} else {
|
$modules{CUL_HM}{defptr}{$src}->{IODev}->{TYPE} =~ m/^(?:TSCUL|HMUARTLGW)$/s);
|
||||||
$wait = 0.300;
|
$wait -= 0.044 if ($flgh & (1 << 6)); # received from Repeater
|
||||||
}
|
|
||||||
$wait -= $hash->{Helper}{RoundTrip}{Delay} if (defined($hash->{Helper}{RoundTrip}{Delay}));
|
|
||||||
|
|
||||||
$modules{CUL_HM}{defptr}{$src}{helper}{io}{nextSend} = $recvtime + $wait
|
$wait -= $hash->{Helper}{RoundTrip}{Delay}
|
||||||
if ($modules{CUL_HM}{defptr}{$src} && $wait > 0);
|
if (defined($hash->{Helper}{RoundTrip}{Delay}));
|
||||||
|
|
||||||
|
if ($wait > 0) {
|
||||||
|
my $nextSend = $recvtime + $wait;
|
||||||
|
$modules{CUL_HM}{defptr}{$src}{helper}{io}{nextSend} = $nextSend
|
||||||
|
if (!defined($modules{CUL_HM}{defptr}{$src}{helper}{io}{nextSend}) ||
|
||||||
|
$nextSend < $modules{CUL_HM}{defptr}{$src}{helper}{io}{nextSend} ||
|
||||||
|
($recvtime - $modules{CUL_HM}{defptr}{$src}{helper}{io}{nextSend}) > 0.09); # not allready set by previous IO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Dispatch($hash, $dmsg, \%addvals);
|
Dispatch($hash, $dmsg, \%addvals);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user