2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-15 16:19:11 +00:00

rapair some bugs, RSSI and others

git-svn-id: https://svn.fhem.de/fhem/trunk@2050 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-11-01 19:39:01 +00:00
parent f93ec49690
commit 106f386f24
2 changed files with 9 additions and 8 deletions

View File

@ -302,11 +302,11 @@ HMLAN_Parse($$)
$dmsg .= "NACK" if($mFld[1] !~ m/00(01|02|21)/ && $letter eq 'R');
$hash->{uptime} = HMLAN_uptime($mFld[2]);
$hash->{RSSI} = hex($mFld[4]);
$hash->{RSSI} = hex($mFld[4])-65536;
$hash->{RAWMSG} = $rmsg;
$hash->{"${name}_MSGCNT"}++;
$hash->{"${name}_TIME"} = TimeNow();
my %addvals = (RAWMSG => $rmsg, RSSI => hex($mFld[4]));
my %addvals = (RAWMSG => $rmsg, RSSI => hex($mFld[4])-65536);
Dispatch($hash, $dmsg, \%addvals);
}
elsif($mFld[0] eq 'HHM-LAN-IF'){#@mFld=(undef,$vers,$serno,$d1,$owner,$msec,$d2)

View File

@ -1421,7 +1421,8 @@ my %culHmSubTypeSets = (
pushButton =>
{ devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",},
virtual =>
{ devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",
{ raw => "data ...",
devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",
press => "[long|short]...",
virtual =>"<noButtons>",}, #redef necessary for virtual
smokeDetector =>
@ -1714,7 +1715,7 @@ CUL_HM_Set($@)
my $reg = $culHmRegDefine{$regName};
return $st." - ".$regName # give some help
." range:". $reg->{min}." to ".$reg->{max}.$reg->{u}
.($reg->{l} == 3)?" peer required":""." : ".$reg->{t}."\n"
.(($reg->{l} == 3)?" peer required":"")." : ".$reg->{t}."\n"
if ($data eq "?");
return "value:".$data." out of range for Reg \"".$regName."\""
if ($data < $reg->{min} ||$data > $reg->{max});
@ -1828,7 +1829,7 @@ CUL_HM_Set($@)
}
elsif($cmd eq "pct") { ######################################################
$a[1] = 100 if ($a[1] > 100);
$tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever
$tval = CUL_HM_encodeTime16(((@a > 2)&&$a[2]!=0)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever
$rval = CUL_HM_encodeTime16((@a > 3)?$a[3]:2.5); # rampTime 0.0..85825945.6, 0=immediate
CUL_HM_PushCmdStack($hash,
sprintf("++%s11%s%s02%s%02X%s%s",$flag,$id,$dst,$chn,$a[1]*2,$rval,$tval));
@ -2400,7 +2401,6 @@ CUL_HM_responseSetup($$$)
# define timeout - holdup cmdStack until response complete or timeout
InternalTimer(gettimeofday()+$rTo, "CUL_HM_respPendTout", "respPend:$dst", 0);
#--- remove readings in channel
my $chnhash = $modules{CUL_HM}{defptr}{"$dst$chn"};
$chnhash = $hash if (!$chnhash);
@ -2503,7 +2503,8 @@ sub
CUL_HM_respPendToutProlong($)
{#used when device sends part responses
my ($hash) = @_;
RemoveInternalTimer("respPend:$hash->{DEF}");# remove responsePending timer?
#RemoveInternalTimer("respPend:$hash->{DEF}");# remove responsePending timer?
InternalTimer(gettimeofday()+1, "CUL_HM_respPendTout", "respPend:$hash->{DEF}", 0);
}
###################################
@ -3301,7 +3302,7 @@ CUL_HM_ActCheck()
my $actName = $actHash->{NAME};
delete ($actHash->{READINGS}); #cleansweep
CUL_HM_setRd($actHash,"status","check performed",$tn);
foreach my $devId (split(",",$attr{$actName}{peerList})){
foreach my $devId (split(",",AttrVal($actName,"peerList","none"))){
my $devName = CUL_HM_id2Name($devId);
if(!$devName || !defined($attr{$devName}{actCycle})){
CUL_HM_ActDel($devId);