From 5a2d22271aedec2163fd5308610e5f6077ee473f Mon Sep 17 00:00:00 2001 From: Soumya Subramanya Date: Tue, 24 Oct 2023 08:28:19 +0200 Subject: [PATCH] Change comparison order in handle get variables Signed-off-by: Soumya Subramanya --- config/v201/config.json | 4 ++-- lib/ocpp/v201/charge_point.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/v201/config.json b/config/v201/config.json index ac5b50359a..983853de66 100644 --- a/config/v201/config.json +++ b/config/v201/config.json @@ -517,7 +517,7 @@ "BytesPerMessageGetVariables": { "variable_name": "BytesPerMessage", "attributes": { - "Actual": 42 + "Actual": 250 }, "instance": "GetVariables" }, @@ -538,7 +538,7 @@ "ItemsPerMessageGetVariables": { "variable_name": "ItemsPerMessage", "attributes": { - "Actual": 42 + "Actual": 2 }, "instance": "GetVariables" }, diff --git a/lib/ocpp/v201/charge_point.cpp b/lib/ocpp/v201/charge_point.cpp index cf60cf5b25..cfd72ecf66 100644 --- a/lib/ocpp/v201/charge_point.cpp +++ b/lib/ocpp/v201/charge_point.cpp @@ -1414,18 +1414,18 @@ void ChargePoint::handle_get_variables_req(const EnhancedMessagedevice_model->get_value(ControllerComponentVariables::BytesPerMessageGetVariables); - // B06.FR.17 - if (message.message_size > max_bytes_per_message) { + // B06.FR.16 + if (msg.getVariableData.size() > max_variables_per_message) { // send a CALLERROR - const auto call_error = CallError(call.uniqueId, "FormatViolation", "", json({})); + const auto call_error = CallError(call.uniqueId, "OccurenceConstraintViolation", "", json({})); this->send(call_error); return; } - // B06.FR.16 - if (msg.getVariableData.size() > max_variables_per_message) { + // B06.FR.17 + if (message.message_size > max_bytes_per_message) { // send a CALLERROR - const auto call_error = CallError(call.uniqueId, "OccurenceConstraintViolation", "", json({})); + const auto call_error = CallError(call.uniqueId, "FormatViolation", "", json({})); this->send(call_error); return; }