mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Lib_teleinfo : Fixed too restrictive checksum checks (#21033)
* Fixed too restrictive checks Fixed too restrictive checks that may introduce checksum errors on some contracts * Bump to v1.1.7 Bump to v1.1.7
This commit is contained in:
parent
2fff690af3
commit
7707473b4e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "LibTeleinfo",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.7",
|
||||
"keywords": "teleinfo, french, meter, power, erdf, linky, tic",
|
||||
"description": "Decoder for Teleinfo (aka TIC) from French smart power meters",
|
||||
"repository":
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=LibTeleinfo
|
||||
version=1.1.5
|
||||
version=1.1.7
|
||||
author=Charles-Henri Hallard <hallard.me>
|
||||
maintainer=Charles-Henri Hallard <community.hallard.me>
|
||||
sentence=Decoder for Teleinfo (aka TIC) from French smart power meters
|
||||
|
@ -700,8 +700,8 @@ unsigned char TInfo::calcChecksum(char *etiquette, char *valeur, char * horodate
|
||||
if (strlen(etiquette) && strlen(valeur)) {
|
||||
while (*etiquette) {
|
||||
c =*etiquette++;
|
||||
// Add another validity check since checksum may not be sufficient
|
||||
if ( (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='-' || c=='+') {
|
||||
// Add another validity check
|
||||
if (c>=0x20 && c<=0x7E) {
|
||||
sum += c ;
|
||||
} else {
|
||||
return 0;
|
||||
@ -710,8 +710,8 @@ unsigned char TInfo::calcChecksum(char *etiquette, char *valeur, char * horodate
|
||||
|
||||
while(*valeur) {
|
||||
c = *valeur++ ;
|
||||
// Add another validity check since checksum may not be sufficient (space authorized in Standard mode)
|
||||
if ( (c>='A' && c<='Z') || (c>='0' && c<='9') || c==' ' || c=='.' || c=='-' || c=='+' || c=='/') {
|
||||
// Add another validity check
|
||||
if (c>=0x20 && c<=0x7E) {
|
||||
sum += c ;
|
||||
} else {
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user