From d0a25cd251052300c2ab055f3afbaa604a551cb8 Mon Sep 17 00:00:00 2001 From: pietfried Date: Fri, 2 Feb 2024 19:02:06 +0100 Subject: [PATCH 1/2] OCPP1.6 module: Now publishing EnhancedChargingSchedules instead of ChargingSchedules. EnhancedChargingSchedules contain a stackLevel in their vector of ChargingSchedulePeriod(s) Signed-off-by: pietfried --- modules/OCPP/OCPP.cpp | 13 +++++++------ modules/OCPP/OCPP.hpp | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/OCPP/OCPP.cpp b/modules/OCPP/OCPP.cpp index 0a4c2d056..ce7fc9d37 100644 --- a/modules/OCPP/OCPP.cpp +++ b/modules/OCPP/OCPP.cpp @@ -142,7 +142,7 @@ void create_empty_user_config(const fs::path& user_config_path) { } } -void OCPP::set_external_limits(const std::map& charging_schedules) { +void OCPP::set_external_limits(const std::map& charging_schedules) { const auto start_time = ocpp::DateTime(); // iterate over all schedules reported by the libocpp to create ExternalLimits @@ -186,7 +186,8 @@ void OCPP::set_external_limits(const std::map& charging_schedules) { +void OCPP::publish_charging_schedules( + const std::map& charging_schedules) { // publish the schedule over mqtt Object j; for (const auto charging_schedule : charging_schedules) { @@ -702,8 +703,8 @@ void OCPP::ready() { } this->charging_schedules_timer = std::make_unique([this]() { - const auto charging_schedules = - this->charge_point->get_all_composite_charging_schedules(this->config.PublishChargingScheduleDurationS); + const auto charging_schedules = this->charge_point->get_all_enhanced_composite_charging_schedules( + this->config.PublishChargingScheduleDurationS); this->set_external_limits(charging_schedules); this->publish_charging_schedules(charging_schedules); }); @@ -715,8 +716,8 @@ void OCPP::ready() { // this is executed when CSMS sends new ChargingProfile that is accepted by // the ChargePoint EVLOG_info << "Received new Charging Schedules from CSMS"; - const auto charging_schedules = - this->charge_point->get_all_composite_charging_schedules(this->config.PublishChargingScheduleDurationS); + const auto charging_schedules = this->charge_point->get_all_enhanced_composite_charging_schedules( + this->config.PublishChargingScheduleDurationS); this->set_external_limits(charging_schedules); this->publish_charging_schedules(charging_schedules); }); diff --git a/modules/OCPP/OCPP.hpp b/modules/OCPP/OCPP.hpp index 3a524ae9f..35da4d27d 100644 --- a/modules/OCPP/OCPP.hpp +++ b/modules/OCPP/OCPP.hpp @@ -126,8 +126,8 @@ class OCPP : public Everest::ModuleBase { // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 // insert your private definitions here std::filesystem::path ocpp_share_path; - void set_external_limits(const std::map& charging_schedules); - void publish_charging_schedules(const std::map& charging_schedules); + void set_external_limits(const std::map& charging_schedules); + void publish_charging_schedules(const std::map& charging_schedules); void init_evse_subscriptions(); // initialize subscriptions to all EVSEs provided by r_evse_manager void init_evse_connector_map(); From 0b190698334d9b11f7455e7e86cc4957f289a284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piet=20G=C3=B6mpel?= <37657534+Pietfried@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:56:56 +0100 Subject: [PATCH 2/2] Update dependencies.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piet Gömpel <37657534+Pietfried@users.noreply.github.com> --- dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index 206f11b84..2f0968188 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -49,7 +49,7 @@ libcurl: # OCPP libocpp: git: https://github.com/EVerest/libocpp.git - git_tag: dfb29de + git_tag: c9827c5 cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBOCPP" # Josev Josev: