From 79cb8059efbeb71bb2684d4dd0ab6535ce7e2070 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Thu, 14 Sep 2023 05:53:04 +0530 Subject: [PATCH] - Fix symbols not getting updated --- library.json | 2 +- library.properties | 2 +- src/Card.cpp | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/library.json b/library.json index dfd875cb..fdf792e4 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "maintainer": true } ], - "version": "4.0.1", + "version": "4.0.2", "frameworks": "arduino", "platforms": "espressif", "dependencies": diff --git a/library.properties b/library.properties index e88457da..dfe7f13b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP-DASH -version=4.0.1 +version=4.0.2 author=Ayush Sharma category=Communication maintainer=Ayush Sharma diff --git a/src/Card.cpp b/src/Card.cpp index c565a625..72e4fcbf 100644 --- a/src/Card.cpp +++ b/src/Card.cpp @@ -36,10 +36,10 @@ void Card::update(int value, const char* symbol){ } /* Store new value */ _value_type = Card::INTEGER; - _symbol = symbol; - if(_value_i != value) + if(strcmp(_symbol.c_str(), symbol) != 0 || _value_i != value) _changed = true; _value_i = value; + _symbol = symbol; } void Card::update(int value){ @@ -61,10 +61,10 @@ void Card::update(float value, const char* symbol){ } /* Store new value */ _value_type = Card::FLOAT; - _symbol = symbol; - if(_value_f != value) + if(strcmp(_symbol.c_str(), symbol) != 0 || _value_f != value) _changed = true; _value_f = value; + _symbol = symbol; } void Card::update(float value){ @@ -92,7 +92,9 @@ void Card::update(const char* value, const char* symbol){ if(strcmp(_value_s.c_str(), value) != 0) _changed = true; } - + if (strcmp(_symbol.c_str(), symbol) != 0) { + _changed = true; + } _value_type = Card::STRING; _symbol = symbol; _value_s = value; @@ -115,10 +117,10 @@ void Card::update(bool value, const char* symbol){ } /* Store new value */ _value_type = Card::INTEGER; - _symbol = symbol; - if(_value_i != value) + if(strcmp(_symbol.c_str(), symbol) != 0 || _value_i != value) _changed = true; _value_i = value; + _symbol = symbol; } void Card::update(bool value){