2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 08:11:44 +00:00

wakeupmode improvement, add alive supervision for HM

git-svn-id: https://svn.fhem.de/fhem/trunk@1981 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-10-16 20:11:04 +00:00
parent 51adaf1d9e
commit aca4737104
3 changed files with 888 additions and 746 deletions

View File

@ -101,7 +101,9 @@ CUL_Initialize($)
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " . $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
"showtime:1,0 model:CUL,CUN,CUR loglevel:0,1,2,3,4,5,6 " . "showtime:1,0 model:CUL,CUN,CUR loglevel:0,1,2,3,4,5,6 " .
"sendpool addvaltrigger " . "sendpool addvaltrigger " .
"rfmode:SlowRF,HomeMatic,MAX hmId hmProtocolEvents"; "rfmode:SlowRF,HomeMatic,MAX hmId ".
"hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger";
$hash->{ShutdownFn} = "CUL_Shutdown"; $hash->{ShutdownFn} = "CUL_Shutdown";
} }

View File

@ -43,7 +43,8 @@ HMLAN_Initialize($)
$hash->{UndefFn} = "HMLAN_Undef"; $hash->{UndefFn} = "HMLAN_Undef";
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " . $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 " .
"loglevel:0,1,2,3,4,5,6 addvaltrigger " . "loglevel:0,1,2,3,4,5,6 addvaltrigger " .
"hmId hmProtocolEvents hmKey"; "hmId hmKey " .
"hmProtocolEvents:0_off,1_dump,2_dumpFull,3_dumpTrigger";
} }
##################################### #####################################
@ -190,8 +191,6 @@ HMLAN_ReadAnswer($$$)
} }
} }
my %lhash;
##################################### #####################################
sub sub
HMLAN_Write($$$) HMLAN_Write($$$)
@ -199,7 +198,7 @@ HMLAN_Write($$$)
my ($hash,$fn,$msg) = @_; my ($hash,$fn,$msg) = @_;
my $dst = substr($msg, 16, 6); my $dst = substr($msg, 16, 6);
if(!$lhash{$dst} && $dst ne "000000") { # Don't think I grok the logic if(hex(substr($msg, 6, 2))&0x01) { # wakeup flag set, shake actor awake
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
@ -208,7 +207,6 @@ HMLAN_Write($$$)
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
HMLAN_SimpleWrite($hash, "+$dst,00,00,"); HMLAN_SimpleWrite($hash, "+$dst,00,00,");
$lhash{$dst} = 1;
} }
my $tm = int(gettimeofday()*1000) % 0xffffffff; my $tm = int(gettimeofday()*1000) % 0xffffffff;
$msg = sprintf("S%08X,00,00000000,01,%08X,%s", $msg = sprintf("S%08X,00,00000000,01,%08X,%s",
@ -217,7 +215,8 @@ HMLAN_Write($$$)
# Avoid problems with structure set # Avoid problems with structure set
# TODO: rewrite it to use a queue+internaltimer like the CUL # TODO: rewrite it to use a queue+internaltimer like the CUL
select(undef, undef, undef, 0.3); # needed for structure set by meesus. select(undef, undef, undef, 0.01); # needed for structure set by meesus.
# may not be needed at all if acks are handled properly
} }
##################################### #####################################
@ -279,6 +278,7 @@ HMLAN_Parse($$)
$dmsg = sprintf("A%02X%s", length($msg)/2, uc($msg)); $dmsg = sprintf("A%02X%s", length($msg)/2, uc($msg));
$dmsg .= "NACK" if($status !~ m/00(01|02|21)/); $dmsg .= "NACK" if($status !~ m/00(01|02|21)/);
$hash->{uptime} = HMLAN_uptime($msec); $hash->{uptime} = HMLAN_uptime($msec);
} elsif($rmsg =~ } elsif($rmsg =~

File diff suppressed because it is too large Load Diff