From 933dca8cc9c99d946b117048cd285488c720faca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piet=20G=C3=B6mpel?= Date: Mon, 20 Oct 2025 15:16:04 +0200 Subject: [PATCH 1/2] feat(slac): Added external slac API module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added slac_API module - External API for SLAC * Added BUSlac module - BringUp module for SLAC * Added API documentation Signed-off-by: Piet Gömpel --- config/bringup/CMakeLists.txt | 1 + config/bringup/config-bringup-api-slac.yaml | 14 + doc/everest_api_specs/slac_API/asyncapi.yaml | 369 +++++++++++++++++++ modules/API/CMakeLists.txt | 1 + modules/API/slac_API/CMakeLists.txt | 29 ++ modules/API/slac_API/doc.rst | 22 ++ modules/API/slac_API/docs/index.rst | 23 ++ modules/API/slac_API/main/slacImpl.cpp | 55 +++ modules/API/slac_API/main/slacImpl.hpp | 67 ++++ modules/API/slac_API/manifest.yaml | 25 ++ modules/API/slac_API/slac_API.cpp | 161 ++++++++ modules/API/slac_API/slac_API.hpp | 100 +++++ modules/BringUp/BUSlac/BUSlac.cpp | 148 ++++++++ modules/BringUp/BUSlac/BUSlac.hpp | 68 ++++ modules/BringUp/BUSlac/CMakeLists.txt | 26 ++ modules/BringUp/BUSlac/doc.rst | 22 ++ modules/BringUp/BUSlac/docs/index.rst | 23 ++ modules/BringUp/BUSlac/main/emptyImpl.cpp | 16 + modules/BringUp/BUSlac/main/emptyImpl.hpp | 60 +++ modules/BringUp/BUSlac/manifest.yaml | 12 + modules/BringUp/CMakeLists.txt | 1 + 21 files changed, 1243 insertions(+) create mode 100644 config/bringup/config-bringup-api-slac.yaml create mode 100644 doc/everest_api_specs/slac_API/asyncapi.yaml create mode 100644 modules/API/slac_API/CMakeLists.txt create mode 100644 modules/API/slac_API/doc.rst create mode 100644 modules/API/slac_API/docs/index.rst create mode 100644 modules/API/slac_API/main/slacImpl.cpp create mode 100644 modules/API/slac_API/main/slacImpl.hpp create mode 100644 modules/API/slac_API/manifest.yaml create mode 100644 modules/API/slac_API/slac_API.cpp create mode 100644 modules/API/slac_API/slac_API.hpp create mode 100644 modules/BringUp/BUSlac/BUSlac.cpp create mode 100644 modules/BringUp/BUSlac/BUSlac.hpp create mode 100644 modules/BringUp/BUSlac/CMakeLists.txt create mode 100644 modules/BringUp/BUSlac/doc.rst create mode 100644 modules/BringUp/BUSlac/docs/index.rst create mode 100644 modules/BringUp/BUSlac/main/emptyImpl.cpp create mode 100644 modules/BringUp/BUSlac/main/emptyImpl.hpp create mode 100644 modules/BringUp/BUSlac/manifest.yaml diff --git a/config/bringup/CMakeLists.txt b/config/bringup/CMakeLists.txt index 3f6b00a86b..c0d2d1d2f8 100644 --- a/config/bringup/CMakeLists.txt +++ b/config/bringup/CMakeLists.txt @@ -5,6 +5,7 @@ generate_config_tmux_run_script(CONFIG bringup-api-isolation-monitor) generate_config_tmux_run_script(CONFIG bringup-api-over-voltage-monitor) generate_config_tmux_run_script(CONFIG bringup-api-powermeter) generate_config_tmux_run_script(CONFIG bringup-api-power-supply-DC) +generate_config_tmux_run_script(CONFIG bringup-api-slac) generate_config_tmux_run_script(CONFIG bringup-api-system) generate_config_tmux_run_script(CONFIG bringup-DZG) diff --git a/config/bringup/config-bringup-api-slac.yaml b/config/bringup/config-bringup-api-slac.yaml new file mode 100644 index 0000000000..0b1ff8225e --- /dev/null +++ b/config/bringup/config-bringup-api-slac.yaml @@ -0,0 +1,14 @@ +settings: + telemetry_enabled: false +active_modules: + slac_api: + module: slac_API + config_module: + cfg_communication_check_to_s: 0 + cli: + module: BUSlac + standalone: true + connections: + slac: + - module_id: slac_api + implementation_id: main diff --git a/doc/everest_api_specs/slac_API/asyncapi.yaml b/doc/everest_api_specs/slac_API/asyncapi.yaml new file mode 100644 index 0000000000..363ea7e6cf --- /dev/null +++ b/doc/everest_api_specs/slac_API/asyncapi.yaml @@ -0,0 +1,369 @@ +--- +asyncapi: 3.0.0 +id: 'pionix:de:everest:slac_API' +info: + title: 'EVerest API definition for SLAC' + version: 1.0.0 + description: >- + API for EVerest API clients implementing SLAC. + license: + name: Apache-2.0 + url: https://opensource.org/licenses/Apache-2.0 + tags: + - name: EVerest + - name: slac +servers: + default: + pathname: 'everest_api/1/slac/{module_id}' + host: 'localhost:1883' + description: default local MQTT + protocol: mqtt + variables: + module_id: + description: The ID of the module as defined in the EVerest config file. +defaultContentType: application/json + +channels: + ############ slac + receive_reset: + address: 'e2m/reset' + messages: + receive_reset: + $ref: '#/components/messages/receive_reset' + receive_enter_bcd: + address: 'e2m/enter_bcd' + messages: + receive_enter_bcd: + $ref: '#/components/messages/receive_enter_bcd' + receive_leave_bcd: + address: 'e2m/leave_bcd' + messages: + receive_leave_bcd: + $ref: '#/components/messages/receive_leave_bcd' + receive_dlink_terminate: + address: 'e2m/dlink_terminate' + messages: + receive_dlink_terminate: + $ref: '#/components/messages/receive_dlink_terminate' + receive_dlink_error: + address: 'e2m/dlink_error' + messages: + receive_dlink_error: + $ref: '#/components/messages/receive_dlink_error' + receive_dlink_pause: + address: 'e2m/dlink_pause' + messages: + receive_dlink_pause: + $ref: '#/components/messages/receive_dlink_pause' + + send_state: + address: 'm2e/state' + messages: + send_state: + $ref: '#/components/messages/send_state' + send_dlink_ready: + address: 'm2e/dlink_ready' + messages: + send_dlink_ready: + $ref: '#/components/messages/send_dlink_ready' + send_request_error_routine: + address: 'm2e/request_error_routine' + messages: + send_request_error_routine: + $ref: '#/components/messages/send_request_error_routine' + send_ev_mac_address: + address: 'm2e/ev_mac_address' + messages: + send_ev_mac_address: + $ref: '#/components/messages/send_ev_mac_address' + + ############ errors + send_raise_error: + address: 'm2e/raise_error' + messages: + send_raise_error: + $ref: '#/components/messages/send_raise_error' + send_clear_error: + address: 'm2e/clear_error' + messages: + send_clear_error: + $ref: '#/components/messages/send_clear_error' + + ############ heartbeat + receive_heartbeat: + address: 'e2m/heartbeat' + messages: + receive_heartbeat: + $ref: '#/components/messages/receive_heartbeat' + send_communication_check: + address: 'm2e/communication_check' + messages: + send_communication_check: + $ref: '#/components/messages/send_communication_check' + +operations: + ############ slac + receive_reset: + title: 'Receive reset' + action: receive + channel: + $ref: '#/channels/receive_reset' + description: 'Direction: EVerest to Module' + receive_enter_bcd: + title: 'Receive enter_bcd' + action: receive + channel: + $ref: '#/channels/receive_enter_bcd' + description: 'Direction: EVerest to Module' + receive_leave_bcd: + title: 'Receive leave_bcd' + action: receive + channel: + $ref: '#/channels/receive_leave_bcd' + description: 'Direction: EVerest to Module' + receive_dlink_terminate: + title: 'Receive dlink_terminate' + action: receive + channel: + $ref: '#/channels/receive_dlink_terminate' + description: 'Direction: EVerest to Module' + receive_dlink_error: + title: 'Receive dlink_error' + action: receive + channel: + $ref: '#/channels/receive_dlink_error' + description: 'Direction: EVerest to Module' + receive_dlink_pause: + title: 'Receive dlink_pause' + action: receive + channel: + $ref: '#/channels/receive_dlink_pause' + description: 'Direction: EVerest to Module' + + send_state: + title: 'Send state' + action: send + channel: + $ref: '#/channels/send_state' + description: 'Direction: Module to EVerest' + send_dlink_ready: + title: 'Send dlink_ready' + action: send + channel: + $ref: '#/channels/send_dlink_ready' + description: 'Direction: Module to EVerest' + send_request_error_routine: + title: 'Send request_error_routine' + action: send + channel: + $ref: '#/channels/send_request_error_routine' + description: 'Direction: Module to EVerest' + send_ev_mac_address: + title: 'Send ev_mac_address' + action: send + channel: + $ref: '#/channels/send_ev_mac_address' + description: 'Direction: Module to EVerest' + + send_raise_error: + title: 'Send raise error' + action: send + channel: + $ref: '#/channels/send_raise_error' + description: 'Direction: Module to EVerest' + send_clear_error: + title: 'Send clear error' + action: send + channel: + $ref : '#/channels/send_clear_error' + + receive_heartbeat: + title: 'Receive heartbeat' + action: receive + channel: + $ref: '#/channels/receive_heartbeat' + description: 'Direction: EVerest to Module' + send_communication_check: + title: 'Send communication check' + action: send + channel: + $ref : '#/channels/send_communication_check' + +components: + messages: + receive_reset: + name: receive_reset + title: 'Reset SLAC' + summary: Reset SLAC + contentType: application/json + payload: + $ref: '#/components/schemas/Enabled' + examples: + - summary: "" + payload: + true + receive_enter_bcd: + name: receive_enter_bcd + title: 'Enter B/C/D' + summary: Signal pilot state change to B/C/D from A/E/F. + receive_leave_bcd: + name: receive_leave_bcd + title: 'Leave B/C/D' + summary: Signal pilot state change to A/E/F from B/C/D. + receive_dlink_terminate: + name: receive_dlink_terminate + title: 'Dlink terminate' + summary: Terminate the data link and become UNMATCHED. + receive_dlink_error: + name: receive_dlink_error + title: 'Dlink error' + summary: Terminate the data link and restart the matching process. + receive_dlink_pause: + name: receive_dlink_pause + title: 'Dlink pause' + summary: Request power saving mode, while staying MATCHED. + + send_state: + name: send_state + title: 'SLAC state' + summary: Provides the state enum. + contentType: application/json + payload: + $ref: '#/components/schemas/SLACState' + examples: + - summary: "Example state MATCHED" + payload: + "state": "MATCHED" + send_dlink_ready: + name: send_dlink_ready + title: 'Dlink ready' + summary: >- + Inform higher layers about a change in data link status. Emits true + if link was set up and false when the link is shut down. + contentType: application/json + payload: + $ref: '#/components/schemas/DLinkStatus' + examples: + - summary: "Example dlink_ready true" + payload: + "dlink_ready": true + send_request_error_routine: + name: send_request_error_routine + title: 'Request error routine' + summary: >- + Inform the higher layer to execute the error routine for a SLAC connection + retry + contentType: application/json + payload: + $ref: '#/components/schemas/NullType' + send_ev_mac_address: + name: send_ev_mac_address + title: 'EV MAC address' + summary: >- + Inform higher layers about the MAC address of the vehicle (upper case) + contentType: application/json + payload: + $ref: '#/components/schemas/MACAddress' + examples: + - summary: "Example MAC address" + payload: + "ev_mac_address": "AA:BB:CC:DD:EE:FF" + + send_raise_error: + name: send_raise_error + title: 'Send raise error' + summary: Signal to EVerest that an error happened. + contentType: application/json + payload: + $ref: '#/components/schemas/Error' + examples: + - summary: "Example error message" + payload: + "type": "CommunicationFault" + "sub_type": "string" + "message": "string" + send_clear_error: + name: send_clear_error + title: 'Send clear error' + summary: Signal to EVerest that an error was resolved. + contentType: application/json + payload: + $ref: '#/components/schemas/Error' + examples: + - summary: Signal to EVerest that a previously raised error is no longer active. + payload: + "type": "CommunicationFault" + "sub_type": "string" + "message": "string" + + receive_heartbeat: + name: receive_heartbeat + title: 'Receive heartbeat' + summary: Heartbeat produced by EVerest as configured via cfg_heartbeat_interval_ms in the EVerest configuration + contentType: application/json + send_communication_check: + name: send_communication_check + title: 'Send communication check' + summary: Signal to EVerest that communication is good or check shall be stopped + contentType: application/json + payload: + $ref: '#/components/schemas/CommunicationCheck' + examples: + - summary: "" + payload: + true + + schemas: + Enabled: + type: boolean + description: 'true: start SLAC after reset, false: stop SLAC' + SLACState: + type: object + properties: + state: + type: string + description: Provides the state enum. + enum: + - UNMATCHED + - MATCHING + - MATCHED + DLinkStatus: + type: object + properties: + dlink_ready: + type: boolean + description: >- + Inform higher layers about a change in data link status. Emits true + if link was set up and false when the link is shut down. + NullType: + type: 'null' + description: Placeholder for null type. + MACAddress: + type: object + properties: + ev_mac_address: + type: string + description: >- + Inform higher layers about the MAC address of the vehicle (upper case) + pattern: ^[A-F0-9]{2}(:[A-F0-9]{2}){5}$ + Error: + type: object + properties: + type: + $ref: '#/components/schemas/ErrorEnum' + sub_type: + type: string + description: Sub-type of the error. + message: + type: string + description: Addition information about the error + ErrorEnum: + type: string + description: | + Type of Error + - CommunicationFault: The communication to the hardware or underlying driver is lost or has errors. + - VendorError: 'Vendor specific error code. Will stop charging session.' + - VendorWarning: 'Vendor specific error code. Charging may continue.' + CommunicationCheck: + type: boolean + description: "Send 'true' at least every 'cfg_communication_check_to_s' seconds to signal module is alive. Send 'false' to stop communication check'" diff --git a/modules/API/CMakeLists.txt b/modules/API/CMakeLists.txt index 3c2d2a9797..aca92b5cca 100644 --- a/modules/API/CMakeLists.txt +++ b/modules/API/CMakeLists.txt @@ -16,4 +16,5 @@ ev_add_module(over_voltage_monitor_API) ev_add_module(power_supply_DC_API) ev_add_module(powermeter_API) ev_add_module(session_cost_API) +ev_add_module(slac_API) ev_add_module(system_API) diff --git a/modules/API/slac_API/CMakeLists.txt b/modules/API/slac_API/CMakeLists.txt new file mode 100644 index 0000000000..40d54f03a5 --- /dev/null +++ b/modules/API/slac_API/CMakeLists.txt @@ -0,0 +1,29 @@ +# +# AUTO GENERATED - MARKED REGIONS WILL BE KEPT +# template version 3 +# + +# module setup: +# - ${MODULE_NAME}: module name +ev_setup_cpp_module() + +# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 +# insert your custom targets and additional config variables here + +target_compile_options(${MODULE_NAME} + PUBLIC -Wall -Wextra -pedantic -Werror=switch) + +target_link_libraries(${MODULE_NAME} + PRIVATE + everest::everest_api_types +) +# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 + +target_sources(${MODULE_NAME} + PRIVATE + "main/slacImpl.cpp" +) + +# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 +# insert other things like install cmds etc here +# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 diff --git a/modules/API/slac_API/doc.rst b/modules/API/slac_API/doc.rst new file mode 100644 index 0000000000..6fc95adc4a --- /dev/null +++ b/modules/API/slac_API/doc.rst @@ -0,0 +1,22 @@ +.. _everest_modules_handwritten_slac_API: + +.. This file is a placeholder for an optional single file + handwritten documentation for the slac_API module. + Please decide whether you want to use this single file, + or a set of files in the doc/ directory. + In the latter case, you can delete this file. + In the former case, you can delete the doc/ directory. + +.. This handwritten documentation is optional. In case + you do not want to write it, you can delete this file + and the doc/ directory. + +.. The documentation can be written in reStructuredText, + and will be converted to HTML and PDF by Sphinx. + +******************************************* +slac_API +******************************************* + +:ref:`Link ` to the module's reference. +API for SLAC communication diff --git a/modules/API/slac_API/docs/index.rst b/modules/API/slac_API/docs/index.rst new file mode 100644 index 0000000000..e38ada74a3 --- /dev/null +++ b/modules/API/slac_API/docs/index.rst @@ -0,0 +1,23 @@ +.. _everest_modules_handwritten_slac_API: + +.. This file is a placeholder for optional multiple files + handwritten documentation for the slac_API module. + Please decide whether you want to use the doc.rst file + or a set of files in the doc/ directory. + In the latter case, you can delete the doc.rst file. + In the former case, you can delete the doc/ directory. + +.. This handwritten documentation is optional. In case + you do not want to write it, you can delete this file + and the doc/ directory. + +.. The documentation can be written in reStructuredText, + and will be converted to HTML and PDF by Sphinx. + This index.rst file is the entry point for the module documentation. + +******************************************* +slac_API +******************************************* + +:ref:`Link ` to the module's reference. +API for SLAC communication diff --git a/modules/API/slac_API/main/slacImpl.cpp b/modules/API/slac_API/main/slacImpl.cpp new file mode 100644 index 0000000000..0801903c08 --- /dev/null +++ b/modules/API/slac_API/main/slacImpl.cpp @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest + +#include "slacImpl.hpp" + +#include +#include +#include + +namespace module { +namespace main { + +using namespace everest::lib::API; +namespace generic = everest::lib::API::V1_0::types::generic; + +void slacImpl::init() { + timeout_s = mod->config.cfg_request_reply_to_s; +} + +void slacImpl::ready() { +} + +void slacImpl::handle_reset(bool& enable) { + const auto topic = mod->get_topics().everest_to_extern("reset"); + const auto data = generic::serialize(enable); + mod->mqtt.publish(topic, data); +} + +void slacImpl::handle_enter_bcd() { + const auto topic = mod->get_topics().everest_to_extern("enter_bcd"); + mod->mqtt.publish(topic, "{}"); +} + +void slacImpl::handle_leave_bcd() { + const auto topic = mod->get_topics().everest_to_extern("leave_bcd"); + mod->mqtt.publish(topic, "{}"); +} + +void slacImpl::handle_dlink_terminate() { + const auto topic = mod->get_topics().everest_to_extern("dlink_terminate"); + mod->mqtt.publish(topic, "{}"); +} + +void slacImpl::handle_dlink_error() { + const auto topic = mod->get_topics().everest_to_extern("dlink_error"); + mod->mqtt.publish(topic, "{}"); +} + +void slacImpl::handle_dlink_pause() { + const auto topic = mod->get_topics().everest_to_extern("dlink_pause"); + mod->mqtt.publish(topic, "{}"); +} + +} // namespace main +} // namespace module diff --git a/modules/API/slac_API/main/slacImpl.hpp b/modules/API/slac_API/main/slacImpl.hpp new file mode 100644 index 0000000000..54651e867a --- /dev/null +++ b/modules/API/slac_API/main/slacImpl.hpp @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#ifndef MAIN_SLAC_IMPL_HPP +#define MAIN_SLAC_IMPL_HPP + +// +// AUTO GENERATED - MARKED REGIONS WILL BE KEPT +// template version 3 +// + +#include + +#include "../slac_API.hpp" + +// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 +// insert your custom include headers here +// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 + +namespace module { +namespace main { + +struct Conf {}; + +class slacImpl : public slacImplBase { +public: + slacImpl() = delete; + slacImpl(Everest::ModuleAdapter* ev, const Everest::PtrContainer& mod, Conf& config) : + slacImplBase(ev, "main"), mod(mod), config(config){}; + + // ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 + // insert your public definitions here + // ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 + +protected: + // command handler functions (virtual) + virtual void handle_reset(bool& enable) override; + virtual void handle_enter_bcd() override; + virtual void handle_leave_bcd() override; + virtual void handle_dlink_terminate() override; + virtual void handle_dlink_error() override; + virtual void handle_dlink_pause() override; + + // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 + // insert your protected definitions here + // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 + +private: + const Everest::PtrContainer& mod; + const Conf& config; + + virtual void init() override; + virtual void ready() override; + + // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 + // insert your private definitions here + int timeout_s{5}; + // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 +}; + +// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 +// insert other definitions here +// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 + +} // namespace main +} // namespace module + +#endif // MAIN_SLAC_IMPL_HPP diff --git a/modules/API/slac_API/manifest.yaml b/modules/API/slac_API/manifest.yaml new file mode 100644 index 0000000000..a8fa8b1897 --- /dev/null +++ b/modules/API/slac_API/manifest.yaml @@ -0,0 +1,25 @@ +description: API for SLAC communication +config: + cfg_communication_check_to_s: + description: "Maximum time between two communication check events. Values <= 0 disables communication checks." + type: integer + default: 5 + cfg_heartbeat_interval_ms: + description: "Interval between two heartbeat messages send by the API. Values <= 0 disable heartbeat" + type: integer + default: 1000 + cfg_request_reply_to_s: + description: "Maximum time between request and reply. After timeout the request is answered with a default response." + type: integer + default: 550 + minimum: 1 + maximum: 550 +provides: + main: + interface: slac + description: "Allows EVerest to control SLAC communication via API clients." +enable_external_mqtt: true +metadata: + license: https://opensource.org/licenses/Apache-2.0 + authors: + - Piet Gömpel diff --git a/modules/API/slac_API/slac_API.cpp b/modules/API/slac_API/slac_API.cpp new file mode 100644 index 0000000000..3acecde331 --- /dev/null +++ b/modules/API/slac_API/slac_API.cpp @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#include "slac_API.hpp" + +#include +#include +#include +#include +#include + +namespace module { + +namespace ev_API_types = ev_API::V1_0::types; +namespace API_types_ext = ev_API_types::slac; +namespace API_generic = ev_API_types::generic; +using ev_API::deserialize; + +void slac_API::init() { + invoke_init(*p_main); + + topics.setTargetApiModuleID(info.id, "slac"); +} + +void slac_API::ready() { + invoke_ready(*p_main); + generate_api_var_state(); + generate_api_var_dlink_ready(); + generate_api_var_request_error_routine(); + generate_api_var_ev_mac_address(); + + generate_api_var_communication_check(); + + generate_api_var_raise_error(); + generate_api_var_clear_error(); + + comm_check.start(config.cfg_communication_check_to_s); + setup_heartbeat_generator(); +} + +const ev_API::Topics& slac_API::get_topics() const { + return topics; +} + +void slac_API::subscribe_api_topic(std::string const& var, ParseAndPublishFtor const& parse_and_publish) { + const auto topic = topics.extern_to_everest(var); + mqtt.subscribe(topic, [=](const std::string& data) { + try { + if (not parse_and_publish(data)) { + EVLOG_warning << "Invalid data: Deserialization failed.\n" << topic << "\n" << data; + } + } catch (const std::exception& e) { + EVLOG_warning << "Topic: '" << topic << "' failed with -> " << e.what() << "\n => " << data; + } catch (...) { + EVLOG_warning << "Invalid data: Failed to parse JSON or to get data from it.\n" << topic; + } + }); +} + +void slac_API::generate_api_var_state() { + subscribe_api_topic("state", [=](const std::string& data) { + API_types_ext::State val; + if (deserialize(data, val)) { + p_main->publish_state(serialize(val)); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_dlink_ready() { + subscribe_api_topic("dlink_ready", [=](const std::string& data) { + bool val = false; + if (deserialize(data, val)) { + p_main->publish_dlink_ready(val); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_request_error_routine() { + subscribe_api_topic("request_error_routine", [=](const std::string& data) { + bool val = false; + if (deserialize(data, val)) { + p_main->publish_request_error_routine(nullptr); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_ev_mac_address() { + subscribe_api_topic("ev_mac_address", [=](const std::string& data) { + std::string val; + if (deserialize(data, val)) { + p_main->publish_ev_mac_address(val); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_communication_check() { + subscribe_api_topic("communication_check", [this](std::string const& data) { + bool val = false; + if (deserialize(data, val)) { + comm_check.set_value(val); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_raise_error() { + subscribe_api_topic("raise_error", [=](std::string const& data) { + API_generic::Error error; + if (deserialize(data, error)) { + auto sub_type_str = error.sub_type ? error.sub_type.value() : ""; + auto message_str = error.message ? error.message.value() : ""; + auto error_str = make_error_string(error); + auto ev_error = p_main->error_factory->create_error(error_str, sub_type_str, message_str, + Everest::error::Severity::High); + p_main->raise_error(ev_error); + return true; + } + return false; + }); +} + +void slac_API::generate_api_var_clear_error() { + subscribe_api_topic("clear_error", [=](std::string const& data) { + API_generic::Error error; + if (deserialize(data, error)) { + std::string error_str = make_error_string(error); + if (error.sub_type) { + p_main->clear_error(error_str, error.sub_type.value()); + } else { + p_main->clear_error(error_str); + } + return true; + } + return false; + }); +} + +std::string slac_API::make_error_string(API_generic::Error const& error) { + auto error_str = API_generic::trimmed(serialize(error.type)); + auto result = "generic/" + error_str; + return result; +} + +void slac_API::setup_heartbeat_generator() { + auto topic = topics.everest_to_extern("heartbeat"); + auto action = [this, topic]() { + mqtt.publish(topic, "{}"); + return true; + }; + comm_check.heartbeat(config.cfg_heartbeat_interval_ms, action); +} + +} // namespace module diff --git a/modules/API/slac_API/slac_API.hpp b/modules/API/slac_API/slac_API.hpp new file mode 100644 index 0000000000..e3395d42a6 --- /dev/null +++ b/modules/API/slac_API/slac_API.hpp @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#ifndef SLAC_API_HPP +#define SLAC_API_HPP + +// +// AUTO GENERATED - MARKED REGIONS WILL BE KEPT +// template version 2 +// + +#include "ld-ev.hpp" + +// headers for provided interface implementations +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wunused-function" +#include +#pragma GCC diagnostic pop + +// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 +// insert your custom include headers here +#include +#include +#include +#include + +namespace ev_API = everest::lib::API; +namespace API_types = ev_API::V1_0::types; +namespace API_generic = API_types::generic; + +// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 + +namespace module { + +struct Conf { + int cfg_communication_check_to_s; + int cfg_heartbeat_interval_ms; + int cfg_request_reply_to_s; +}; + +class slac_API : public Everest::ModuleBase { +public: + slac_API() = delete; + slac_API(const ModuleInfo& info, Everest::MqttProvider& mqtt_provider, std::unique_ptr p_main, + Conf& config) : + ModuleBase(info), + mqtt(mqtt_provider), + p_main(std::move(p_main)), + config(config), + comm_check("slac/CommunicationFault", "Bridge to implementation connection lost", this->p_main) { + } + + Everest::MqttProvider& mqtt; + const std::shared_ptr p_main; + const Conf& config; + + // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 + // insert your public definitions here + const ev_API::Topics& get_topics() const; + ev_API::CommCheckHandler comm_check; + // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 + +protected: + // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 + // insert your protected definitions here + // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 + +private: + friend class LdEverest; + void init(); + void ready(); + + // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 + // insert your private definitions here + using ParseAndPublishFtor = std::function; + void subscribe_api_topic(std::string const& var, ParseAndPublishFtor const& parse_and_publish); + void generate_api_var_state(); + void generate_api_var_dlink_ready(); + void generate_api_var_request_error_routine(); + void generate_api_var_ev_mac_address(); + void generate_api_var_communication_check(); + + void generate_api_var_raise_error(); + void generate_api_var_clear_error(); + + std::string make_error_string(API_generic::Error const& error); + + void setup_heartbeat_generator(); + + ev_API::Topics topics; + // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 +}; + +// ev@087e516b-124c-48df-94fb-109508c7cda9:v1 +// insert other definitions here +// ev@087e516b-124c-48df-94fb-109508c7cda9:v1 + +} // namespace module + +#endif // SLAC_API_HPP diff --git a/modules/BringUp/BUSlac/BUSlac.cpp b/modules/BringUp/BUSlac/BUSlac.cpp new file mode 100644 index 0000000000..46afbac698 --- /dev/null +++ b/modules/BringUp/BUSlac/BUSlac.cpp @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#include "BUSlac.hpp" + +#include "ftxui/dom/table.hpp" +#include +#include +#include + +using namespace ftxui; + +namespace module { + +void BUSlac::init() { + invoke_init(*p_main); +} + +void BUSlac::ready() { + invoke_ready(*p_main); + + auto screen = ScreenInteractive::Fullscreen(); + + r_slac->subscribe_state([this, &screen](const std::string& new_state) { + { + std::scoped_lock lock(data_mutex); + state = new_state; + } + screen.PostEvent(Event::Custom); + }); + + r_slac->subscribe_dlink_ready([this, &screen](const bool& is_ready) { + { + std::scoped_lock lock(data_mutex); + dlink = is_ready ? "true" : "false"; + } + screen.PostEvent(Event::Custom); + }); + + r_slac->subscribe_request_error_routine([this, &screen]() { + { + std::scoped_lock lock(data_mutex); + last_request_error_routine_timestamp = std::to_string( + std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()) + .count()); + } + screen.PostEvent(Event::Custom); + }); + + r_slac->subscribe_ev_mac_address([this, &screen](const std::string& mac) { + { + std::scoped_lock lock(data_mutex); + ev_mac_address = mac; + } + screen.PostEvent(Event::Custom); + }); + + // ------------------------------------------------------------------- + // Left column (Var Display) + // ------------------------------------------------------------------- + auto data_renderer = Renderer([&] { + std::vector> table_content; + + { + std::scoped_lock lock(data_mutex); + table_content = { + {"State", state}, + {"DLink Ready", dlink}, + {"Last Request Error Routine", last_request_error_routine_timestamp}, + {"EV MAC Address", ev_mac_address}, + }; + } + + auto table = Table(table_content); + + table.SelectAll().Border(LIGHT); + table.SelectColumn(0).Border(LIGHT); + for (int i = 0; i < (int)table_content.size(); ++i) + table.SelectRow(i).Border(LIGHT); + + return vbox({ + window(text("Module Data"), vbox({ + table.Render(), + })) | + size(WIDTH, EQUAL, 40), + }) | + flex_grow; + }); + + // ------------------------------------------------------------------- + // Right column (Command Buttons) + // ------------------------------------------------------------------- + + auto button_start_slac = Button("Start SLAC", [&] { r_slac->call_reset(true); }); + auto button_stop_slac = Button("Stop SLAC", [&] { r_slac->call_reset(false); }); + auto button_enter_bcd = Button("Enter BCD", [&] { r_slac->call_enter_bcd(); }); + auto button_leave_bcd = Button("Leave BCD", [&] { r_slac->call_leave_bcd(); }); + auto button_dlink_terminate = Button("DLink Terminate", [&] { r_slac->call_dlink_terminate(); }); + auto button_dlink_error = Button("DLink Error", [&] { r_slac->call_dlink_error(); }); + auto button_dlink_pause = Button("DLink Pause", [&] { r_slac->call_dlink_pause(); }); + + // Compose the command panel layout + auto command_container = Container::Vertical({ + Container::Horizontal({button_start_slac, button_stop_slac}), + button_enter_bcd, + button_leave_bcd, + button_dlink_terminate, + button_dlink_error, + button_dlink_pause, + }); + + auto command_renderer = Renderer(command_container, [&] { + return vbox({ + text("Commands") | bold | center, + separator(), + button_start_slac->Render(), + button_stop_slac->Render(), + button_enter_bcd->Render(), + button_leave_bcd->Render(), + button_dlink_terminate->Render(), + button_dlink_error->Render(), + button_dlink_pause->Render(), + }) | + border | size(WIDTH, EQUAL, 40); + }); + + // ------------------------------------------------------------------- + // Combine columns + // ------------------------------------------------------------------- + auto layout = Container::Horizontal({ + data_renderer, + command_renderer, + }); + + auto main_renderer = Renderer(layout, [&] { + return vbox({ + text("SLAC BringUp") | bold | center, + separator(), + hbox({ + data_renderer->Render(), + command_renderer->Render(), + }), + }); + }); + + screen.Loop(main_renderer); +} + +} // namespace module diff --git a/modules/BringUp/BUSlac/BUSlac.hpp b/modules/BringUp/BUSlac/BUSlac.hpp new file mode 100644 index 0000000000..9eab49b1ab --- /dev/null +++ b/modules/BringUp/BUSlac/BUSlac.hpp @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#ifndef BUSLAC_HPP +#define BUSLAC_HPP + +// +// AUTO GENERATED - MARKED REGIONS WILL BE KEPT +// template version 2 +// + +#include "ld-ev.hpp" + +// headers for provided interface implementations +#include + +// headers for required interface implementations +#include + +// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 +// insert your custom include headers here +// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 + +namespace module { + +struct Conf {}; + +class BUSlac : public Everest::ModuleBase { +public: + BUSlac() = delete; + BUSlac(const ModuleInfo& info, std::unique_ptr p_main, std::unique_ptr r_slac, + Conf& config) : + ModuleBase(info), p_main(std::move(p_main)), r_slac(std::move(r_slac)), config(config){}; + + const std::unique_ptr p_main; + const std::unique_ptr r_slac; + const Conf& config; + + // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 + // insert your public definitions here + // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 + +protected: + // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 + // insert your protected definitions here + // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 + +private: + friend class LdEverest; + void init(); + void ready(); + + // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 + // insert your private definitions here + std::mutex data_mutex; + std::string state; + std::string dlink; + std::string last_request_error_routine_timestamp; + std::string ev_mac_address; + // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 +}; + +// ev@087e516b-124c-48df-94fb-109508c7cda9:v1 +// insert other definitions here +// ev@087e516b-124c-48df-94fb-109508c7cda9:v1 + +} // namespace module + +#endif // BUSLAC_HPP diff --git a/modules/BringUp/BUSlac/CMakeLists.txt b/modules/BringUp/BUSlac/CMakeLists.txt new file mode 100644 index 0000000000..612371e253 --- /dev/null +++ b/modules/BringUp/BUSlac/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# AUTO GENERATED - MARKED REGIONS WILL BE KEPT +# template version 3 +# + +# module setup: +# - ${MODULE_NAME}: module name +ev_setup_cpp_module() + +# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 +# insert your custom targets and additional config variables here +target_link_libraries(${MODULE_NAME} + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +) +# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 + +target_sources(${MODULE_NAME} + PRIVATE + "main/emptyImpl.cpp" +) + +# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 +# insert other things like install cmds etc here +# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 diff --git a/modules/BringUp/BUSlac/doc.rst b/modules/BringUp/BUSlac/doc.rst new file mode 100644 index 0000000000..a5db96e7f8 --- /dev/null +++ b/modules/BringUp/BUSlac/doc.rst @@ -0,0 +1,22 @@ +.. _everest_modules_handwritten_BUSlac: + +.. This file is a placeholder for an optional single file + handwritten documentation for the BUSlac module. + Please decide whether you want to use this single file, + or a set of files in the doc/ directory. + In the latter case, you can delete this file. + In the former case, you can delete the doc/ directory. + +.. This handwritten documentation is optional. In case + you do not want to write it, you can delete this file + and the doc/ directory. + +.. The documentation can be written in reStructuredText, + and will be converted to HTML and PDF by Sphinx. + +******************************************* +BUSlac +******************************************* + +:ref:`Link ` to the module's reference. +Interactive bring up helper for SLAC interface diff --git a/modules/BringUp/BUSlac/docs/index.rst b/modules/BringUp/BUSlac/docs/index.rst new file mode 100644 index 0000000000..e1c54afe1e --- /dev/null +++ b/modules/BringUp/BUSlac/docs/index.rst @@ -0,0 +1,23 @@ +.. _everest_modules_handwritten_BUSlac: + +.. This file is a placeholder for optional multiple files + handwritten documentation for the BUSlac module. + Please decide whether you want to use the doc.rst file + or a set of files in the doc/ directory. + In the latter case, you can delete the doc.rst file. + In the former case, you can delete the doc/ directory. + +.. This handwritten documentation is optional. In case + you do not want to write it, you can delete this file + and the doc/ directory. + +.. The documentation can be written in reStructuredText, + and will be converted to HTML and PDF by Sphinx. + This index.rst file is the entry point for the module documentation. + +******************************************* +BUSlac +******************************************* + +:ref:`Link ` to the module's reference. +Interactive bring up helper for SLAC interface diff --git a/modules/BringUp/BUSlac/main/emptyImpl.cpp b/modules/BringUp/BUSlac/main/emptyImpl.cpp new file mode 100644 index 0000000000..e69326b6ca --- /dev/null +++ b/modules/BringUp/BUSlac/main/emptyImpl.cpp @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest + +#include "emptyImpl.hpp" + +namespace module { +namespace main { + +void emptyImpl::init() { +} + +void emptyImpl::ready() { +} + +} // namespace main +} // namespace module diff --git a/modules/BringUp/BUSlac/main/emptyImpl.hpp b/modules/BringUp/BUSlac/main/emptyImpl.hpp new file mode 100644 index 0000000000..d63bd846e2 --- /dev/null +++ b/modules/BringUp/BUSlac/main/emptyImpl.hpp @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Pionix GmbH and Contributors to EVerest +#ifndef MAIN_EMPTY_IMPL_HPP +#define MAIN_EMPTY_IMPL_HPP + +// +// AUTO GENERATED - MARKED REGIONS WILL BE KEPT +// template version 3 +// + +#include + +#include "../BUSlac.hpp" + +// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 +// insert your custom include headers here +// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 + +namespace module { +namespace main { + +struct Conf {}; + +class emptyImpl : public emptyImplBase { +public: + emptyImpl() = delete; + emptyImpl(Everest::ModuleAdapter* ev, const Everest::PtrContainer& mod, Conf& config) : + emptyImplBase(ev, "main"), mod(mod), config(config){}; + + // ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 + // insert your public definitions here + // ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 + +protected: + // no commands defined for this interface + + // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 + // insert your protected definitions here + // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 + +private: + const Everest::PtrContainer& mod; + const Conf& config; + + virtual void init() override; + virtual void ready() override; + + // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 + // insert your private definitions here + // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 +}; + +// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 +// insert other definitions here +// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 + +} // namespace main +} // namespace module + +#endif // MAIN_EMPTY_IMPL_HPP diff --git a/modules/BringUp/BUSlac/manifest.yaml b/modules/BringUp/BUSlac/manifest.yaml new file mode 100644 index 0000000000..29bfe16c8b --- /dev/null +++ b/modules/BringUp/BUSlac/manifest.yaml @@ -0,0 +1,12 @@ +description: Interactive bring up helper for SLAC interface +provides: + main: + interface: empty + description: This module does not provide anything +requires: + slac: + interface: slac +metadata: + license: https://opensource.org/licenses/Apache-2.0 + authors: + - Piet Gömpel diff --git a/modules/BringUp/CMakeLists.txt b/modules/BringUp/CMakeLists.txt index 8048ded947..c5aebc67df 100644 --- a/modules/BringUp/CMakeLists.txt +++ b/modules/BringUp/CMakeLists.txt @@ -8,6 +8,7 @@ else() ev_add_module(BUOverVoltageMonitor) ev_add_module(BUPowerSupplyDC) ev_add_module(BUPowermeter) + ev_add_module(BUSlac) ev_add_module(BUSystem) ev_add_module(BUTokenProvider) endif() From ee44f752e4d1526a3abe7ff41e7ac6b1821ebcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piet=20G=C3=B6mpel?= Date: Mon, 3 Nov 2025 10:56:23 +0100 Subject: [PATCH 2/2] Addressed requested changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Piet Gömpel --- doc/everest_api_specs/slac_API/asyncapi.yaml | 5 +---- modules/API/slac_API/doc.rst | 2 ++ modules/API/slac_API/main/slacImpl.cpp | 1 - modules/API/slac_API/main/slacImpl.hpp | 1 - modules/API/slac_API/manifest.yaml | 6 ------ modules/API/slac_API/slac_API.cpp | 10 +++------- modules/API/slac_API/slac_API.hpp | 3 +-- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/doc/everest_api_specs/slac_API/asyncapi.yaml b/doc/everest_api_specs/slac_API/asyncapi.yaml index 363ea7e6cf..2fd3da9999 100644 --- a/doc/everest_api_specs/slac_API/asyncapi.yaml +++ b/doc/everest_api_specs/slac_API/asyncapi.yaml @@ -255,7 +255,7 @@ components: retry contentType: application/json payload: - $ref: '#/components/schemas/NullType' + type: 'null' send_ev_mac_address: name: send_ev_mac_address title: 'EV MAC address' @@ -335,9 +335,6 @@ components: description: >- Inform higher layers about a change in data link status. Emits true if link was set up and false when the link is shut down. - NullType: - type: 'null' - description: Placeholder for null type. MACAddress: type: object properties: diff --git a/modules/API/slac_API/doc.rst b/modules/API/slac_API/doc.rst index 6fc95adc4a..5e2b150a40 100644 --- a/modules/API/slac_API/doc.rst +++ b/modules/API/slac_API/doc.rst @@ -20,3 +20,5 @@ slac_API :ref:`Link ` to the module's reference. API for SLAC communication + +See ``doc/everest_api_specs/slac_API/asyncapi.yaml`` for a full AsyncAPI specification. diff --git a/modules/API/slac_API/main/slacImpl.cpp b/modules/API/slac_API/main/slacImpl.cpp index 0801903c08..98d69f032a 100644 --- a/modules/API/slac_API/main/slacImpl.cpp +++ b/modules/API/slac_API/main/slacImpl.cpp @@ -14,7 +14,6 @@ using namespace everest::lib::API; namespace generic = everest::lib::API::V1_0::types::generic; void slacImpl::init() { - timeout_s = mod->config.cfg_request_reply_to_s; } void slacImpl::ready() { diff --git a/modules/API/slac_API/main/slacImpl.hpp b/modules/API/slac_API/main/slacImpl.hpp index 54651e867a..f3711ee0e7 100644 --- a/modules/API/slac_API/main/slacImpl.hpp +++ b/modules/API/slac_API/main/slacImpl.hpp @@ -53,7 +53,6 @@ class slacImpl : public slacImplBase { // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 // insert your private definitions here - int timeout_s{5}; // ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 }; diff --git a/modules/API/slac_API/manifest.yaml b/modules/API/slac_API/manifest.yaml index a8fa8b1897..9243b8fb57 100644 --- a/modules/API/slac_API/manifest.yaml +++ b/modules/API/slac_API/manifest.yaml @@ -8,12 +8,6 @@ config: description: "Interval between two heartbeat messages send by the API. Values <= 0 disable heartbeat" type: integer default: 1000 - cfg_request_reply_to_s: - description: "Maximum time between request and reply. After timeout the request is answered with a default response." - type: integer - default: 550 - minimum: 1 - maximum: 550 provides: main: interface: slac diff --git a/modules/API/slac_API/slac_API.cpp b/modules/API/slac_API/slac_API.cpp index 3acecde331..cd9eb9ba60 100644 --- a/modules/API/slac_API/slac_API.cpp +++ b/modules/API/slac_API/slac_API.cpp @@ -18,7 +18,7 @@ using ev_API::deserialize; void slac_API::init() { invoke_init(*p_main); - topics.setTargetApiModuleID(info.id, "slac"); + topics.setup(info.id, "slac", 1); } void slac_API::ready() { @@ -80,12 +80,8 @@ void slac_API::generate_api_var_dlink_ready() { void slac_API::generate_api_var_request_error_routine() { subscribe_api_topic("request_error_routine", [=](const std::string& data) { - bool val = false; - if (deserialize(data, val)) { - p_main->publish_request_error_routine(nullptr); - return true; - } - return false; + p_main->publish_request_error_routine(nullptr); + return true; }); } diff --git a/modules/API/slac_API/slac_API.hpp b/modules/API/slac_API/slac_API.hpp index e3395d42a6..abb4de6393 100644 --- a/modules/API/slac_API/slac_API.hpp +++ b/modules/API/slac_API/slac_API.hpp @@ -35,7 +35,6 @@ namespace module { struct Conf { int cfg_communication_check_to_s; int cfg_heartbeat_interval_ms; - int cfg_request_reply_to_s; }; class slac_API : public Everest::ModuleBase { @@ -47,7 +46,7 @@ class slac_API : public Everest::ModuleBase { mqtt(mqtt_provider), p_main(std::move(p_main)), config(config), - comm_check("slac/CommunicationFault", "Bridge to implementation connection lost", this->p_main) { + comm_check("generic/CommunicationFault", "Bridge to implementation connection lost", this->p_main) { } Everest::MqttProvider& mqtt;