2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 20:24:36 +00:00

speed improvement for FW download faktor 2

git-svn-id: https://svn.fhem.de/fhem/trunk@6295 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-07-22 05:18:52 +00:00
parent 307dfe0c78
commit b8b71e588b

View File

@ -1871,7 +1871,7 @@ sub CUL_HM_Parse($$) {#########################################################
} }
elsif($mTp eq "41") {#01 is channel elsif($mTp eq "41") {#01 is channel
my($cnt,$bright) = (hex($mI[1]),hex($mI[2])); my($cnt,$bright) = (hex($mI[1]),hex($mI[2]));
my $nextTr = (@mI >2)? (int((1<<((hex($mI[3])>>4)-1))/1.1)."s") my $nextTr = (@mI >3)? (int((1<<((hex($mI[3])>>4)-1))/1.1)."s")
: "-"; : "-";
push @evtEt,[$shash,1,"state:motion"]; push @evtEt,[$shash,1,"state:motion"];
push @evtEt,[$shash,1,"motion:on$target"]; push @evtEt,[$shash,1,"motion:on$target"];
@ -3165,7 +3165,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
if ($sectIn eq "all") { if ($sectIn eq "all") {
@sectL = ("rssi","msgEvents","readings");#readings is last - it schedules a reread possible @sectL = ("rssi","msgEvents","readings");#readings is last - it schedules a reread possible
} }
elsif($sectIn =~ m/(rssi|msgEvents|readings|register)/){ elsif($sectIn =~ m/(rssi|msgEvents|readings|register|unknownDev)/){
@sectL = ($sectIn); @sectL = ($sectIn);
} }
else{ else{
@ -3180,6 +3180,10 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
CUL_HM_complConfig($_->{NAME}) foreach (@cH); CUL_HM_complConfig($_->{NAME}) foreach (@cH);
CUL_HM_qStateUpdatIfEnab($_->{NAME}) foreach (@cH); CUL_HM_qStateUpdatIfEnab($_->{NAME}) foreach (@cH);
} }
elsif($sect eq "unknownDev"){
delete $hash->{READINGS}{$_}
foreach (grep /^unknown_/,keys %{$hash->{READINGS}});
}
elsif($sect eq "register"){ elsif($sect eq "register"){
my @cH = ($hash); my @cH = ($hash);
push @cH,$defs{$hash->{$_}} foreach(grep /^channel/,keys %{$hash}); push @cH,$defs{$hash->{$_}} foreach(grep /^channel/,keys %{$hash});
@ -5208,9 +5212,8 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
$modules{CUL_HM}{helper}{updateNbr} = $mNo; $modules{CUL_HM}{helper}{updateNbr} = $mNo;
RemoveInternalTimer("fail:notInBootLoader"); RemoveInternalTimer("fail:notInBootLoader");
#InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0); #InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0);
# InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateEnd","fail:SpeedChangeFailed",0);
} }
# else{# check response - start programming
##16.130 CUL_Parse: A 0A 30 0002 235EDB 255E91 00 ##16.130 CUL_Parse: A 0A 30 0002 235EDB 255E91 00
##16.338 CUL_Parse: A 0A 39 0002 235EDB 255E91 00 ##16.338 CUL_Parse: A 0A 39 0002 235EDB 255E91 00
##16.716 CUL_Parse: A 0A 42 0002 235EDB 255E91 00 ##16.716 CUL_Parse: A 0A 42 0002 235EDB 255E91 00
@ -5225,7 +5228,6 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
## one block = 10 messages in 200-1000ms ## one block = 10 messages in 200-1000ms
my $blocks = scalar(@{$modules{CUL_HM}{helper}{updateData}}); my $blocks = scalar(@{$modules{CUL_HM}{helper}{updateData}});
RemoveInternalTimer("respPend:$hash->{DEF}"); RemoveInternalTimer("respPend:$hash->{DEF}");
# RemoveInternalTimer("fail:SpeedChangeFailed");
RemoveInternalTimer("fail:Block".($step-1)); RemoveInternalTimer("fail:Block".($step-1));
if ($blocks < $step){#last block if ($blocks < $step){#last block
CUL_HM_FWupdateEnd("done"); CUL_HM_FWupdateEnd("done");
@ -5238,14 +5240,13 @@ sub CUL_HM_FWupdateSteps($){#steps for FW update
foreach my $msgP (@{$bl}){ foreach my $msgP (@{$bl}){
$mNo = (++$mNo)%256; $mNoA = sprintf("%02X",$mNo); $mNo = (++$mNo)%256; $mNoA = sprintf("%02X",$mNo);
CUL_HM_SndCmd($hash, $mNoA.((--$no)?"00":"20")."CA$id$dst".$msgP); CUL_HM_SndCmd($hash, $mNoA.((--$no)?"00":"20")."CA$id$dst".$msgP);
select(undef, undef, undef, (0.1)); # select(undef, undef, undef, (0.01));# no wait necessary - FHEM is slow anyway
} }
$modules{CUL_HM}{helper}{updateStep}++; $modules{CUL_HM}{helper}{updateStep}++;
$modules{CUL_HM}{helper}{updateNbr} = $mNo; $modules{CUL_HM}{helper}{updateNbr} = $mNo;
#InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0); #InternalTimer(gettimeofday()+0.3,"CUL_HM_FWupdateSim","${dst}${id}00",0);
InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateBTo","fail:Block$step",0); InternalTimer(gettimeofday()+5,"CUL_HM_FWupdateBTo","fail:Block$step",0);
} }
# }
} }
sub CUL_HM_FWupdateBTo($){# FW update block timeout sub CUL_HM_FWupdateBTo($){# FW update block timeout
my $in = shift; my $in = shift;