CUL_MAX: use culfw's auto-ack

git-svn-id: https://svn.fhem.de/fhem/trunk@2481 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre
2013-01-11 23:34:02 +00:00
parent 24adf067c3
commit 45f67ca03e

View File

@@ -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);