2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-26 04:14:13 +00:00

00_ZWDongle.pm: irrelevant fixes, some comments

git-svn-id: https://svn.fhem.de/fhem/trunk@15181 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-10-03 10:33:02 +00:00
parent 6265308523
commit 6c27a37800

View File

@ -153,7 +153,7 @@ ZWDongle_Define($$)
$hash->{nrNAck} = 0;
my @empty;
$hash->{SendStack} = \@empty;
ZWDongle_shiftSendStack($hash, 0, 5, undef);
ZWDongle_shiftSendStack($hash, 0, 5, undef); # Init variables
my $ret = DevIo_OpenDev($hash, 0, "ZWDongle_DoInit");
return $ret;
@ -657,6 +657,10 @@ ZWDongle_Write($$$)
ZWDongle_ProcessSendStack($hash);
}
# Flags:
# - WaitForAck: 0:Written, 1:SerialACK received, 2:RF-Sent
# - SendRetries < MaxSendRetries(3, up to 7 when receiving CAN)
sub
ZWDongle_shiftSendStack($$$$;$)
{
@ -666,7 +670,7 @@ ZWDongle_shiftSendStack($$$$;$)
if($cmd && $reason==0 && $cmd =~ m/^01..0013/) { # ACK for SEND_DATA
Log3 $hash, $loglevel, "$txt, WaitForAck=>2 for $cmd"
if($txt && $cmd);
if($txt);
$hash->{WaitForAck}=2;
} else {
@ -752,7 +756,7 @@ ZWDongle_Read($@)
#Log3 $name, 5, "ZWDongle RAW buffer: $data";
my $msg;
while(length($data) > 0) {
while(length($data) >= 2) {
my $fb = substr($data, 0, 2);