2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 19:04:20 +00:00

sign on/off tested & fixed

git-svn-id: https://svn.fhem.de/fhem/trunk@860 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2011-03-13 09:18:58 +00:00
parent 6c476fcad8
commit 546a823698
2 changed files with 15 additions and 11 deletions

View File

@ -325,6 +325,7 @@ HMLAN_SimpleWrite(@)
my $name = $hash->{NAME};
return if(!$hash || AttrVal($hash->{NAME}, "dummy", undef));
select(undef, undef, undef, 0.01);
Log GetLogLevel($name,5), "SW: $msg";
$msg .= "\r\n" unless($nonl);

View File

@ -191,8 +191,11 @@ CUL_HM_Parse($$)
$dname = "broadcast" if($dst eq "000000");
$dname = $iohash->{NAME} if($dst eq $id);
if($p =~ m/NACK$/) {
if($p =~ m/NACK$/) { # HMLAN special
if($dhash) {
delete($dhash->{ackCmdSent});
delete($dhash->{ackWaiting});
delete($dhash->{cmdStack});
$dhash->{STATE} = "MISSING ACK";
DoTrigger($dname, "MISSING ACK");
}
@ -520,6 +523,12 @@ CUL_HM_Set($@)
} elsif($cmd eq "reset") { ############################################
$sndcmd = sprintf("++A011%s%s0400", $id,$dst);
} elsif($cmd eq "pair") { #############################################
my $serialNr = AttrVal($name, "serialNr", undef);
return "serialNr is not set" if(!$serialNr);
$sndcmd = sprintf("++A401%s000000010A%s", $id, unpack("H*",$serialNr));
$shash->{hmPairSerial} = $serialNr;
} elsif($cmd eq "unpair") { ###########################################
$sndcmd =
sprintf("++A001%s%s00050000000000", $id,$dst);
@ -530,18 +539,12 @@ CUL_HM_Set($@)
} elsif($cmd eq "sign") { ############################################
$sndcmd =
sprintf("++A001%s%s%s050000000000", $id,$dst, $chn);
sprintf("++A001%s%s%s0500000000%s", $id,$dst,$chn,$chn);
CUL_HM_PushCmdStack($shash,
sprintf("++A001%s%s%s0808%s",$id,$dst, $chn,
($a[2] eq "on" ? "01" : "02"));
sprintf("++A001%s%s%s0808%s",$id,$dst,$chn,
($a[2] eq "on" ? "01" : "02")));
CUL_HM_PushCmdStack($shash,
sprintf("++A001%s%s%s06",$id,$dst, $chn));
} elsif($cmd eq "pair") { #############################################
my $serialNr = AttrVal($name, "serialNr", undef);
return "serialNr is not set" if(!$serialNr);
$sndcmd = sprintf("++A401%s000000010A%s", $id, unpack("H*",$serialNr));
$shash->{hmPairSerial} = $serialNr;
sprintf("++A001%s%s%s06",$id,$dst,$chn));
} elsif($cmd eq "statusRequest") { ####################################
$sndcmd = sprintf("++A001%s%s%s0E", $id,$dst, $chn);