mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
improve dummy handling
git-svn-id: https://svn.fhem.de/fhem/trunk@6403 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fc376368cb
commit
dfa16d169f
@ -275,9 +275,15 @@ sub HMLAN_Attr(@) {############################################################
|
|||||||
RemoveInternalTimer( "keepAliveCk:".$name);
|
RemoveInternalTimer( "keepAliveCk:".$name);
|
||||||
RemoveInternalTimer( "keepAlive:".$name);
|
RemoveInternalTimer( "keepAlive:".$name);
|
||||||
DevIo_CloseDev($defs{$name});
|
DevIo_CloseDev($defs{$name});
|
||||||
HMLAN_condUpdate($defs{$name},251);#set dummy
|
HMLAN_condUpdate($defs{$name},251);#state: dummy
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
if ($cmd eq "set"){
|
||||||
|
$attr{$name}{$aName} = $aVal;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
delete $attr{$name}{$aName};
|
||||||
|
}
|
||||||
DevIo_OpenDev($defs{$name}, 1, "HMLAN_DoInit");
|
DevIo_OpenDev($defs{$name}, 1, "HMLAN_DoInit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,7 +439,7 @@ sub HMLAN_Write($$$) {#########################################################
|
|||||||
HMLAN_SimpleWrite($hash,$msg);
|
HMLAN_SimpleWrite($hash,$msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elsif (length($msg)>22){
|
elsif (length($msg)>21){
|
||||||
my ($mtype,$src,$dst) = (substr($msg, 8, 2),
|
my ($mtype,$src,$dst) = (substr($msg, 8, 2),
|
||||||
substr($msg, 10, 6),
|
substr($msg, 10, 6),
|
||||||
substr($msg, 16, 6));
|
substr($msg, 16, 6));
|
||||||
@ -752,8 +758,7 @@ sub HMLAN_Ready($) {###########################################################
|
|||||||
}
|
}
|
||||||
sub HMLAN_SimpleWrite(@) {#####################################################
|
sub HMLAN_SimpleWrite(@) {#####################################################
|
||||||
my ($hash, $msg, $nonl) = @_;
|
my ($hash, $msg, $nonl) = @_;
|
||||||
|
return if(!$hash || AttrVal($hash->{NAME}, "dummy", 0) != 0);
|
||||||
return if(!$hash || AttrVal($hash->{NAME}, "dummy", undef));
|
|
||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $len = length($msg);
|
my $len = length($msg);
|
||||||
|
@ -4824,7 +4824,7 @@ sub CUL_HM_ProcessCmdStack($) {
|
|||||||
|
|
||||||
if (!$hash->{helper}{prt}{rspWait}{cmd}){
|
if (!$hash->{helper}{prt}{rspWait}{cmd}){
|
||||||
if($hash->{cmdStack} && @{$hash->{cmdStack}}){
|
if($hash->{cmdStack} && @{$hash->{cmdStack}}){
|
||||||
CUL_HM_SndCmd($hash, shift @{$hash->{cmdStack}});
|
CUL_HM_SndCmd($hash, shift @{$hash->{cmdStack}});
|
||||||
}
|
}
|
||||||
elsif($hash->{helper}{prt}{sProc} != 0){
|
elsif($hash->{helper}{prt}{sProc} != 0){
|
||||||
CUL_HM_protState($hash,"CMDs_done");
|
CUL_HM_protState($hash,"CMDs_done");
|
||||||
@ -5028,8 +5028,11 @@ sub CUL_HM_sndIfOpen($) {
|
|||||||
sub CUL_HM_SndCmd($$) {
|
sub CUL_HM_SndCmd($$) {
|
||||||
my ($hash, $cmd) = @_;
|
my ($hash, $cmd) = @_;
|
||||||
$hash = CUL_HM_getDeviceHash($hash);
|
$hash = CUL_HM_getDeviceHash($hash);
|
||||||
return if( AttrVal($hash->{NAME},"ignore","")
|
if( AttrVal($hash->{NAME},"ignore",0) != 0
|
||||||
|| AttrVal($hash->{NAME},"dummy",""));
|
|| AttrVal($hash->{NAME},"dummy" ,0) != 0){
|
||||||
|
CUL_HM_eventP($hash,"dummy");
|
||||||
|
return;
|
||||||
|
}
|
||||||
CUL_HM_assignIO($hash) ;
|
CUL_HM_assignIO($hash) ;
|
||||||
if(!defined $hash->{IODev} ||!defined $hash->{IODev}{NAME}){
|
if(!defined $hash->{IODev} ||!defined $hash->{IODev}{NAME}){
|
||||||
CUL_HM_eventP($hash,"IOerr");
|
CUL_HM_eventP($hash,"IOerr");
|
||||||
@ -5397,7 +5400,7 @@ sub CUL_HM_eventP($$) {#handle protocol events
|
|||||||
my ($evntCnt,undef) = split(' last_at:',$evnt);
|
my ($evntCnt,undef) = split(' last_at:',$evnt);
|
||||||
$nAttr->{"prot".$evntType} = ++$evntCnt." last_at:".TimeNow();
|
$nAttr->{"prot".$evntType} = ++$evntCnt." last_at:".TimeNow();
|
||||||
|
|
||||||
if ($evntType =~ m/(Nack|ResndFail|IOerr)/){# unrecoverable Error
|
if ($evntType =~ m/(Nack|ResndFail|IOerr|dummy)/){# unrecoverable Error
|
||||||
CUL_HM_UpdtReadSingle($hash,"state",$evntType,1);
|
CUL_HM_UpdtReadSingle($hash,"state",$evntType,1);
|
||||||
$hash->{helper}{prt}{bErr}++;
|
$hash->{helper}{prt}{bErr}++;
|
||||||
$nAttr->{protCmdDel} = 0 if(!$nAttr->{protCmdDel});
|
$nAttr->{protCmdDel} = 0 if(!$nAttr->{protCmdDel});
|
||||||
@ -5423,6 +5426,7 @@ sub CUL_HM_eventP($$) {#handle protocol events
|
|||||||
sub CUL_HM_protState($$){
|
sub CUL_HM_protState($$){
|
||||||
my ($hash,$state) = @_;
|
my ($hash,$state) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
my $sProcIn = $hash->{helper}{prt}{sProc};
|
my $sProcIn = $hash->{helper}{prt}{sProc};
|
||||||
if ($sProcIn == 3){#FW update processing
|
if ($sProcIn == 3){#FW update processing
|
||||||
# do not change state - commandstack is bypassed
|
# do not change state - commandstack is bypassed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user