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:
Charles 2024-03-26 08:46:55 +01:00 committed by GitHub
parent 2fff690af3
commit 7707473b4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -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":

View File

@ -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

View File

@ -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;