2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

14_CUL_TCM97001.pm: Fix checksum calculation for GT_WT_02

git-svn-id: https://svn.fhem.de/fhem/trunk@12742 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dancer0705 2016-12-11 13:56:33 +00:00
parent c8de6b1c3f
commit 29c3c84fa2
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 14_CUL_TCM97001: Fix checksum calculation for GT_WT_02
- change: 10_IT: Implementation for HE800 de-/encoding
Implementation for HE800 dimmer
Fix wrong return values

View File

@ -202,9 +202,10 @@ sub checkCRC_Mebus {
sub checkCRC_GTWT02 {
my $msg = shift;
my @a = split("", $msg);
my $CRC = (hex($a[0])+hex($a[1])+hex($a[2])+hex($a[3])
+hex($a[4])+hex($a[5])+hex($a[6])+hex($a[7])) -1;
+hex($a[4])+hex($a[5])+hex($a[6])+(hex($a[7]) & 0xE));
# my $CRC = (hex($a[0])+hex($a[1])+hex($a[2])+hex($a[3])
# +hex($a[4])+hex($a[5])+hex($a[6])+hex($a[7])) -1;
my $CRCCHECKVAL= (hex($a[7].$a[8].$a[9]) & 0x1F8) >> 3;
if ($CRC == $CRCCHECKVAL) {
return TRUE;
@ -1247,6 +1248,8 @@ CUL_TCM97001_Parse($$)
=pod
=item summary This module interprets temperature sensor messages.
=item summary_DE Module verarbeitet empfangene Nachrichten von Temp-Sensoren.
=begin html
<a name="CUL_TCM97001"></a>