2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

00_ZWDongle.pm: backgroundRSSI patch from krikan (Forum #79893)

git-svn-id: https://svn.fhem.de/fhem/trunk@15489 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-11-23 21:39:50 +00:00
parent 0240d7c61a
commit 95955e9d13

View File

@ -58,6 +58,7 @@ my %sets = (
); );
my %gets = ( my %gets = (
"backgroundRSSI" => "3b", # GET_BACKGROUND_RSSI
"caps" => "07", # SERIAL_API_GET_CAPABILITIES "caps" => "07", # SERIAL_API_GET_CAPABILITIES
"ctrlCaps" => "05", # ZW_GET_CONTROLLER_CAPS "ctrlCaps" => "05", # ZW_GET_CONTROLLER_CAPS
"homeId" => "20", # MEMORY_GET_ID "homeId" => "20", # MEMORY_GET_ID
@ -561,6 +562,27 @@ ZWDongle_Get($@)
push @list, ("at ".($f==1 ? "9.6": ($f==2 ? "40":"100"))."kbps") push @list, ("at ".($f==1 ? "9.6": ($f==2 ? "40":"100"))."kbps")
if(@list && $f =~ m/[123]/); if(@list && $f =~ m/[123]/);
$msg = (@list ? join(" ", @list) : "N/A"); $msg = (@list ? join(" ", @list) : "N/A");
} elsif($cmd eq "backgroundRSSI") { ############################
my @list;
my $i=0;
my $maxlen = (length($msg) >= 12 ? 10 : length($msg)-2);
for(my $off=4; $off<$maxlen; $off+=2) {
my $dec = hex(substr($msg, $off, 2));
if($dec == 127 || $dec == 0) {
push @list, ("ch".($i+1).":N/A");
} elsif($dec == 126) {
push @list, ("ch".($i+1).":aboveMaxPower");
} elsif($dec == 125) {
push @list, ("ch".($i+1).":belowReceiverSensitivity");
} elsif($dec > 161 && $dec < 225) {
push @list, ("ch".($i+1).":".unpack('c', pack('C', $dec))." dBm");
} else {
push @list, ("ch".($i+1).":reservedValue");
}
$i++
}
$msg = join(" ", @list);
} }
$cmd .= "_".join("_", @a) if(@a); $cmd .= "_".join("_", @a) if(@a);
@ -1180,10 +1202,9 @@ ZWDongle_Ready($)
<li>homeId<br> <li>homeId<br>
return the six hex-digit homeId of the controller. return the six hex-digit homeId of the controller.
</li> </li>
<li>isFailedNode &lt;device&gt;<br> <li>backgroundRSSI<br>
return if a node is stored in the failed node list. &lt;device&gt; is query the measured RSSI on the Z-Wave network
either device name or decimal nodeId.
</li> </li>
<li>caps, ctrlCaps, version<br> <li>caps, ctrlCaps, version<br>
@ -1191,6 +1212,11 @@ ZWDongle_Ready($)
only. only.
</li> </li>
<li>isFailedNode &lt;device&gt;<br>
return if a node is stored in the failed node list. &lt;device&gt; is
either device name or decimal nodeId.
</li>
<li>neighborList [excludeDead] [onlyRep] &lt;device&gt;<br> <li>neighborList [excludeDead] [onlyRep] &lt;device&gt;<br>
return neighborList of the &lt;device&gt;.<br> return neighborList of the &lt;device&gt;.<br>
&lt;device&gt; is either device name or decimal nodeId.<br> &lt;device&gt; is either device name or decimal nodeId.<br>