From 3d0d7ba8cb66062e41fab979ebf27e46e1784a0e Mon Sep 17 00:00:00 2001 From: martinp876 Date: Wed, 11 Dec 2013 19:39:04 +0000 Subject: [PATCH] wakeup devices obey autonomous messages git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4362 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index cdc19a05e..0f2af053b 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -1581,12 +1581,17 @@ sub CUL_HM_parseCommon(@){##################################################### # VD wakes up with 8202 # 9610 - if( ((hex($mFlg) & 0xA2) == 0x82) && - (CUL_HM_getRxType($shash) & 0x08)){ #wakeup and process stack - CUL_HM_appFromQ($shash->{NAME},"wu");# stack cmds if waiting - if ($shash->{cmdStack}){ - CUL_HM_SndCmd($shash, '++A112'.CUL_HM_IOid($shash).$src); - CUL_HM_ProcessCmdStack($shash); + if(CUL_HM_getRxType($shash) & 0x08){ #wakeup device + if((hex($mFlg) & 0xA2) == 0x82){ #wakeup signal + CUL_HM_appFromQ($shash->{NAME},"wu");# stack cmds if waiting + if ($shash->{cmdStack}){ + CUL_HM_SndCmd($shash, '++A112'.CUL_HM_IOid($shash).$src); + CUL_HM_ProcessCmdStack($shash); + } + } + elsif($shash->{helper}{prt}{sProc} != 1){ # no wakeup signal, + # this is an autonom message send ACK but dont process further + $shash->{helper}{prt}{sleeping} = 1 if(hex($mFlg) & 0x20) ; } } my $repeat; @@ -3684,8 +3689,13 @@ sub CUL_HM_responseSetup($$) {#store all we need to handle the response } else{# no answer expected if($hash->{cmdStack} && scalar @{$hash->{cmdStack}}){ - CUL_HM_protState($hash,"CMDs_processing..."); - InternalTimer(gettimeofday()+.5, "CUL_HM_ProcessCmdStack", $hash, 0); + if (!$hash->{helper}{prt}{sleeping}){ + CUL_HM_protState($hash,"CMDs_processing..."); + InternalTimer(gettimeofday()+.5, "CUL_HM_ProcessCmdStack", $hash, 0); + } + else{ + delete $hash->{helper}{prt}{sleeping}; + } } elsif(!$hash->{helper}{prt}{rspWait}{cmd}){ CUL_HM_protState($hash,"CMDs_done");