2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 11:26:55 +00:00

autoReadReg after pairing, error for unset IODev

git-svn-id: https://svn.fhem.de/fhem/trunk@4193 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-11-09 17:15:13 +00:00
parent bee05f9d73
commit dcbf48fe68

@ -1652,7 +1652,7 @@ sub CUL_HM_parseCommon(@){#####################################################
CUL_HM_infoUpdtDevData($shash->{NAME}, $shash,$p) CUL_HM_infoUpdtDevData($shash->{NAME}, $shash,$p)
if (!$modules{CUL_HM}{helper}{hmManualOper}#no autoaction if (!$modules{CUL_HM}{helper}{hmManualOper}#no autoaction
||$iohash->{hmPair} ||$iohash->{hmPair}
||$iohash->{hmPairSerial} ); ||$iohash->{hmPairSerial} );
if( $dst =~ m /(000000|$id)/ #--- see if we need to pair if( $dst =~ m /(000000|$id)/ #--- see if we need to pair
&&($iohash->{hmPair} &&($iohash->{hmPair}
||( $iohash->{hmPairSerial} ||( $iohash->{hmPairSerial}
@ -1674,6 +1674,8 @@ sub CUL_HM_parseCommon(@){#####################################################
$idstr =~ s/(..)/sprintf("%02X%s",$s++,$1)/ge; $idstr =~ s/(..)/sprintf("%02X%s",$s++,$1)/ge;
CUL_HM_pushConfig($shash, $id, $src,0,0,0,0, "0201$idstr"); CUL_HM_pushConfig($shash, $id, $src,0,0,0,0, "0201$idstr");
CUL_HM_ProcessCmdStack($shash); # start processing immediately CUL_HM_ProcessCmdStack($shash); # start processing immediately
CUL_HM_appFromQ($shash->{NAME},"cf");# stack cmds if waiting
} }
elsif(CUL_HM_getRxType($shash) & 0x04){# nothing to pair - maybe send config elsif(CUL_HM_getRxType($shash) & 0x04){# nothing to pair - maybe send config
CUL_HM_appFromQ($shash->{NAME},"cf"); # stack cmds if waiting CUL_HM_appFromQ($shash->{NAME},"cf"); # stack cmds if waiting
@ -2301,7 +2303,6 @@ sub CUL_HM_Set($@) {
} }
} }
elsif($sect eq "msgEvents"){ elsif($sect eq "msgEvents"){
return if (!$hash->{IODev}{NAME});
CUL_HM_respPendRm($hash); CUL_HM_respPendRm($hash);
$hash->{helper}{prt}{bErr}=0; $hash->{helper}{prt}{bErr}=0;
@ -2315,7 +2316,8 @@ sub CUL_HM_Set($@) {
my $protLastRcv = $hash->{protLastRcv} if ($hash->{protLastRcv}); my $protLastRcv = $hash->{protLastRcv} if ($hash->{protLastRcv});
delete ($hash->{$_}) foreach (grep(/^prot/,keys %{$hash})); delete ($hash->{$_}) foreach (grep(/^prot/,keys %{$hash}));
$hash->{protLastRcv} = $protLastRcv if ($protLastRcv); $hash->{protLastRcv} = $protLastRcv if ($protLastRcv);
if ($modules{CUL_HM}{$hash->{IODev}{NAME}} && if ($hash->{IODev}{NAME} &&
$modules{CUL_HM}{$hash->{IODev}{NAME}} &&
$modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}){ $modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}){
@{$modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}} = @{$modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}} =
grep !/$name/,@{$modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}}; grep !/$name/,@{$modules{CUL_HM}{$hash->{IODev}{NAME}}{pendDev}};
@ -3628,10 +3630,14 @@ sub CUL_HM_SndCmd($$) {
my ($hash, $cmd) = @_; my ($hash, $cmd) = @_;
$hash = CUL_HM_getDeviceHash($hash); $hash = CUL_HM_getDeviceHash($hash);
my $io = $hash->{IODev}; my $io = $hash->{IODev};
return if( !$io return if( AttrVal($hash->{NAME},"ignore","")
|| AttrVal($hash->{NAME},"ignore","")
|| AttrVal($hash->{NAME},"dummy","")); || AttrVal($hash->{NAME},"dummy",""));
my $ioName = $io->{NAME}; my $ioName = $io->{NAME};
if(!$io || !$ioName){
CUL_HM_eventP($hash,"IOerr");
CUL_HM_UpdtReadSingle($hash,"state","ERR_IOdev_undefined",1);
return;
};
if ( $io->{STATE} !~ m/^(opened|Initialized)$/ # we need to queue if ( $io->{STATE} !~ m/^(opened|Initialized)$/ # we need to queue
||(hex substr($cmd,2,2) & 0x20) && ( # check for commands with resp-req ||(hex substr($cmd,2,2) & 0x20) && ( # check for commands with resp-req
$modules{CUL_HM}{$ioName}{tmr} # queue already running $modules{CUL_HM}{$ioName}{tmr} # queue already running