From 80b7bb066e5723932cf34105fd5eb56ebed0babc Mon Sep 17 00:00:00 2001 From: matth-x <63792403+matth-x@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:06:38 +0200 Subject: [PATCH 1/3] make txId in TxProfile optional (addresses #346) --- src/MicroOcpp/Operations/SetChargingProfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MicroOcpp/Operations/SetChargingProfile.cpp b/src/MicroOcpp/Operations/SetChargingProfile.cpp index 20cf5ca8..5119db35 100644 --- a/src/MicroOcpp/Operations/SetChargingProfile.cpp +++ b/src/MicroOcpp/Operations/SetChargingProfile.cpp @@ -65,7 +65,7 @@ void SetChargingProfile::processReq(JsonObject payload) { return; } - if (chargingProfile->getTransactionId() < 0 || + if (chargingProfile->getTransactionId() >= 0 || chargingProfile->getTransactionId() != transaction->getTransactionId()) { //transactionId undefined / mismatch accepted = false; From 8ca8691dd76a5a26512c51a01a8b69c760d5b274 Mon Sep 17 00:00:00 2001 From: matth-x <63792403+matth-x@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:11:04 +0200 Subject: [PATCH 2/3] fix TxProfile txId check condition (addresses #346) --- src/MicroOcpp/Operations/SetChargingProfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MicroOcpp/Operations/SetChargingProfile.cpp b/src/MicroOcpp/Operations/SetChargingProfile.cpp index 5119db35..1e991bbd 100644 --- a/src/MicroOcpp/Operations/SetChargingProfile.cpp +++ b/src/MicroOcpp/Operations/SetChargingProfile.cpp @@ -65,7 +65,7 @@ void SetChargingProfile::processReq(JsonObject payload) { return; } - if (chargingProfile->getTransactionId() >= 0 || + if (chargingProfile->getTransactionId() >= 0 && chargingProfile->getTransactionId() != transaction->getTransactionId()) { //transactionId undefined / mismatch accepted = false; From 2ceb0286dd340ed960c2fc18c2860d22822b9c4e Mon Sep 17 00:00:00 2001 From: matth-x <63792403+matth-x@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:32:51 +0200 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90671c6..9d51891d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,7 @@ - Change arduinoWebSockets URL param to path ([#278](https://github.com/matth-x/MicroOcpp/issues/278)) - Avoid creating conf when operation fails ([#290](https://github.com/matth-x/MicroOcpp/pull/290)) - Fix whitespaces in MeterValues ([#301](https://github.com/matth-x/MicroOcpp/pull/301)) +- Make SmartChargingProfile txId field optional ([#348](https://github.com/matth-x/MicroOcpp/pull/348)) ## [1.0.3] - 2024-04-06