From 45f67ca03e72ce77e7847c0f19db686cc46da34d Mon Sep 17 00:00:00 2001 From: mgehre Date: Fri, 11 Jan 2013 23:34:02 +0000 Subject: [PATCH] CUL_MAX: use culfw's auto-ack git-svn-id: https://svn.fhem.de/fhem/trunk@2481 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/14_CUL_MAX.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/14_CUL_MAX.pm b/fhem/FHEM/14_CUL_MAX.pm index 138707822..c50e182b4 100644 --- a/fhem/FHEM/14_CUL_MAX.pm +++ b/fhem/FHEM/14_CUL_MAX.pm @@ -69,7 +69,11 @@ CUL_MAX_Define($$) $hash->{retryCount} = 0; $hash->{devices} = (); AssignIoPort($hash); - CUL_MAX_Check($hash); + + if(CUL_MAX_Check($hash)) { + #Doing this on older firmware disables MAX mode + IOWrite($hash, "", "Za". $hash->{addr}); + } #This interface is shared with 00_MAXLAN.pm $hash->{SendDeviceCmd} = \&CUL_MAX_SendDeviceCmd; @@ -109,9 +113,11 @@ CUL_MAX_Check($@) #Looks like "V 1.49 CUL868" $version =~ m/V (.*)\.(.*) CUL.*/; my ($major_version,$minorversion) = ($1, $2); - if($major_version == 1 and $minorversion < 50) { - Log 2, "The current firmware of the CUL has known bugs with respect to MAX! support. Please update." + if($major_version == 1 and $minorversion < 52) { + Log 2, "The current firmware of the CUL has known bugs with respect to MAX! support. Please update."; + return 0; } + return 1; } sub @@ -170,6 +176,7 @@ CUL_MAX_Parse($$) if(exists($msgId2Cmd{$msgTypeRaw})) { if($msgType eq "Ack") { + return undef if($src eq $shash->{addr}); #Ignore packets generated by culfw's auto-Ack Dispatch($shash, "MAX,$isToMe,Ack,$src,$payload", {RAWMSG => $rmsg}); return undef if(!$isToMe);