2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-12 02:39:57 +00:00

10_EnOcean: rcv secure: pass signal telegram; snd secure: CDM telegrams are not encrypted, transmission delay between the split CDM telegrams set to 10 msec

git-svn-id: https://svn.fhem.de/fhem/trunk@29783 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
klaus.schauer 2025-03-24 20:48:51 +00:00
parent 6d79e65554
commit 346d6698e6

View File

@ -6105,7 +6105,7 @@ sub EnOcean_Set($@) {
# Multisensor Lockable Windows Handle # Multisensor Lockable Windows Handle
# (D2-06-40) # (D2-06-40)
$rorg = "D2"; $rorg = "D2";
$updateState = 0; $updateState = 3;
if ($cmd eq "block") { if ($cmd eq "block") {
# set unlock allowance info # set unlock allowance info
if (defined $a[1]) { if (defined $a[1]) {
@ -7990,6 +7990,9 @@ sub EnOcean_Parse($$) {
} elsif ($rorg eq "35") { } elsif ($rorg eq "35") {
# pass second teach-in telegram # pass second teach-in telegram
} elsif ($rorg eq "D0") {
# pass signal telegram
} else { } else {
Log3 $name, 2, "EnOcean $name unsecure telegram locked"; Log3 $name, 2, "EnOcean $name unsecure telegram locked";
return ""; return "";
@ -16886,14 +16889,14 @@ sub EnOcean_CreateSVG($$$) {
$autocreateWeblinkRoom = 'EnOcean' if ($autocreateWeblinkRoom eq '%TYPE'); $autocreateWeblinkRoom = 'EnOcean' if ($autocreateWeblinkRoom eq '%TYPE');
$autocreateWeblinkRoom = $name if ($autocreateWeblinkRoom eq '%NAME'); $autocreateWeblinkRoom = $name if ($autocreateWeblinkRoom eq '%NAME');
$autocreateWeblinkRoom = $attr{$name}{room} if (exists $attr{$name}{room}); $autocreateWeblinkRoom = $attr{$name}{room} if (exists $attr{$name}{room});
my $wnr = 1; my $wnr = 0;
#create SVG devices #create SVG devices
foreach my $wdef (split(/,/, $EnO_eepConfig{$eep}{GPLOT})) { foreach my $wdef (split(/,/, $EnO_eepConfig{$eep}{GPLOT})) {
next if(!$wdef); next if(!$wdef);
my ($gplotfile, $stuff) = split(/:/, $wdef); my ($gplotfile, $stuff) = split(/:/, $wdef);
next if(!$gplotfile); next if(!$gplotfile);
$weblinkName = "SVG_$name"; $weblinkName = "SVG_$name";
$weblinkName .= "_$wnr" if($wnr > 1); $weblinkName .= "_$wnr" if($wnr > 0);
$wnr++; $wnr++;
next if (exists $defs{$weblinkName}); next if (exists $defs{$weblinkName});
$cmd = "$weblinkName SVG $filelogName:$gplotfile:CURRENT"; $cmd = "$weblinkName SVG $filelogName:$gplotfile:CURRENT";
@ -17160,13 +17163,15 @@ sub EnOcean_SndCdm($$$$$$$$) {
} }
if ($packetType == 1 && $len > $dataPartLen) { if ($packetType == 1 && $len > $dataPartLen) {
# first CDM telegram # first CDM telegram
#my $rorgCdm = $rorg =~ /^3[15]$/ ? 33 : 40;
my $rorgCdm = 40;
$dataPartMask = $dataPartLen - 8; $dataPartMask = $dataPartLen - 8;
$data =~ m/^(.{$dataPartMask})(.*)$/; $data =~ m/^(.{$dataPartMask})(.*)$/;
$dataPart = (sprintf "%02X", $seq << 6 | $idx) . (sprintf "%04X", $len / 2) . $rorg . $1; $dataPart = (sprintf "%02X", $seq << 6 | $idx) . (sprintf "%04X", $len / 2) . $rorg . $1;
$data = $2; $data = $2;
$idx ++; $idx ++;
$len -= $dataPartMask; $len -= $dataPartMask;
EnOcean_SndRadio($ctrl, $hash, $packetType, "40", $dataPart, $senderID, $status, $destinationID); EnOcean_SndRadio($ctrl, $hash, $packetType, $rorgCdm, $dataPart, $senderID, $status, $destinationID);
$dataPartMask = $dataPartLen - 2; $dataPartMask = $dataPartLen - 2;
while ($len > 0) { while ($len > 0) {
if ($len > $dataPartLen - 2) { if ($len > $dataPartLen - 2) {
@ -17179,7 +17184,9 @@ sub EnOcean_SndCdm($$$$$$$$) {
$dataPart = (sprintf "%02X", $seq << 6 | $idx) . $data; $dataPart = (sprintf "%02X", $seq << 6 | $idx) . $data;
$len = 0; $len = 0;
} }
EnOcean_SndRadio($ctrl, $hash, $packetType, "40", $dataPart, $senderID, $status, $destinationID); EnOcean_SndRadio($ctrl, $hash, $packetType, $rorgCdm, $dataPart, $senderID, $status, $destinationID);
# next part will be sent with 5 ms delay
usleep(10000);
} }
} else { } else {
# not necessary to split # not necessary to split
@ -18948,7 +18955,7 @@ sub EnOcean_sec_convertToSecure($$$$) {
# no encryption with different set profile, required for the LED control of the model Eltako_F4CT55 # no encryption with different set profile, required for the LED control of the model Eltako_F4CT55
my $subTypeSet = AttrVal($name, "subTypeSet", ""); my $subTypeSet = AttrVal($name, "subTypeSet", "");
# encryption needed? # encryption needed?
return ($err, $rorg, $data, $response, 5) if ($rorg =~ m/^F6|35|D0$/ || $secLevel !~ m/^encapsulation|encryption$/ || $subType eq "STE" || $subTypeSet eq "switch"); return ($err, $rorg, $data, $response, 5) if ($rorg =~ /^F6|33|35|40|D0$/ || $secLevel !~ /^encapsulation|encryption$/ || $subTypeSet eq "switch");
return ("Cryptographic functions are not available", undef, undef, $response, 2) if ($cryptFunc == 0); return ("Cryptographic functions are not available", undef, undef, $response, 2) if ($cryptFunc == 0);
my $dataEnc = AttrVal($name, "dataEnc", undef); my $dataEnc = AttrVal($name, "dataEnc", undef);
Log3 $name, 5, "EnOcean $name EnOcean_sec_convertToSecure RORG: $rorg DATA: $data"; Log3 $name, 5, "EnOcean $name EnOcean_sec_convertToSecure RORG: $rorg DATA: $data";