From 8e82f26180a5b1f129cc333a565abe5988587e9e Mon Sep 17 00:00:00 2001 From: Valentin Dimov Date: Thu, 7 Dec 2023 13:33:50 +0100 Subject: [PATCH] feat: make message queue delay configurable for OCPP 1.6 as well Signed-off-by: Valentin Dimov --- modules/OCPP/OCPP.cpp | 2 ++ modules/OCPP/OCPP.hpp | 1 + modules/OCPP/manifest.yaml | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/OCPP/OCPP.cpp b/modules/OCPP/OCPP.cpp index 6ef4905d5a..6d6e1a4b77 100644 --- a/modules/OCPP/OCPP.cpp +++ b/modules/OCPP/OCPP.cpp @@ -280,6 +280,8 @@ void OCPP::init() { json_config.dump(), this->ocpp_share_path, user_config_path, std::filesystem::path(this->config.DatabasePath), sql_init_path, std::filesystem::path(this->config.MessageLogPath), std::make_shared(*this->r_security)); + + this->charge_point->set_message_queue_resume_delay(std::chrono::seconds(config.MessageQueueResumeDelay)); } void OCPP::ready() { diff --git a/modules/OCPP/OCPP.hpp b/modules/OCPP/OCPP.hpp index 4800ebbc1b..d364cbaf3a 100644 --- a/modules/OCPP/OCPP.hpp +++ b/modules/OCPP/OCPP.hpp @@ -52,6 +52,7 @@ struct Conf { int PublishChargingScheduleDurationS; std::string MessageLogPath; std::string CertsPath; + int MessageQueueResumeDelay; }; class OCPP : public Everest::ModuleBase { diff --git a/modules/OCPP/manifest.yaml b/modules/OCPP/manifest.yaml index 03aefefe33..ad4e4b00ae 100644 --- a/modules/OCPP/manifest.yaml +++ b/modules/OCPP/manifest.yaml @@ -34,7 +34,11 @@ config: CertsPath: description: Path to folder where certificates are located. If empty uses everest prefix + etc/everest/certs type: string - default: "" + default: ""# + MessageQueueResumeDelay: + description: Time (seconds) to delay resuming the message queue after reconnecting + type: integer + default: 0 provides: main: description: This is a OCPP 1.6 charge point