mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +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",
|
"name": "LibTeleinfo",
|
||||||
"version": "1.1.5",
|
"version": "1.1.7",
|
||||||
"keywords": "teleinfo, french, meter, power, erdf, linky, tic",
|
"keywords": "teleinfo, french, meter, power, erdf, linky, tic",
|
||||||
"description": "Decoder for Teleinfo (aka TIC) from French smart power meters",
|
"description": "Decoder for Teleinfo (aka TIC) from French smart power meters",
|
||||||
"repository":
|
"repository":
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=LibTeleinfo
|
name=LibTeleinfo
|
||||||
version=1.1.5
|
version=1.1.7
|
||||||
author=Charles-Henri Hallard <hallard.me>
|
author=Charles-Henri Hallard <hallard.me>
|
||||||
maintainer=Charles-Henri Hallard <community.hallard.me>
|
maintainer=Charles-Henri Hallard <community.hallard.me>
|
||||||
sentence=Decoder for Teleinfo (aka TIC) from French smart power meters
|
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)) {
|
if (strlen(etiquette) && strlen(valeur)) {
|
||||||
while (*etiquette) {
|
while (*etiquette) {
|
||||||
c =*etiquette++;
|
c =*etiquette++;
|
||||||
// Add another validity check since checksum may not be sufficient
|
// Add another validity check
|
||||||
if ( (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='-' || c=='+') {
|
if (c>=0x20 && c<=0x7E) {
|
||||||
sum += c ;
|
sum += c ;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
@ -710,8 +710,8 @@ unsigned char TInfo::calcChecksum(char *etiquette, char *valeur, char * horodate
|
|||||||
|
|
||||||
while(*valeur) {
|
while(*valeur) {
|
||||||
c = *valeur++ ;
|
c = *valeur++ ;
|
||||||
// Add another validity check since checksum may not be sufficient (space authorized in Standard mode)
|
// Add another validity check
|
||||||
if ( (c>='A' && c<='Z') || (c>='0' && c<='9') || c==' ' || c=='.' || c=='-' || c=='+' || c=='/') {
|
if (c>=0x20 && c<=0x7E) {
|
||||||
sum += c ;
|
sum += c ;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user