From 0c6449f8faf569833c4c4480edd3d06ecc4e3b5e Mon Sep 17 00:00:00 2001 From: Sebastian Lukas <45936573+SebaLukas@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:56:48 +0100 Subject: [PATCH] Refactoring iso15118 EVerest types (#1050) - Removing iso15118_ev type file - Renamed iso15118_charger type file to iso15118 - Adding generated iso types for OCPP2.1 (ChargingNeedsType) - Refactored the enum types - Removing ChargingSchedule type - Spelling mistakes changed - clang-format Signed-off-by: Sebastian Lukas --- interfaces/ISO15118_charger.yaml | 40 +- interfaces/ISO15118_ev.yaml | 10 +- interfaces/iso15118_extensions.yaml | 4 +- .../DummyV2G/main/ISO15118_chargerImpl.cpp | 23 +- .../DummyV2G/main/ISO15118_chargerImpl.hpp | 23 +- modules/EvManager/main/car_simulation.cpp | 6 +- .../charger/ISO15118_chargerImpl.cpp | 45 +- .../charger/ISO15118_chargerImpl.hpp | 23 +- modules/Evse15118D20/charger/utils.hpp | 6 +- .../extensions/iso15118_extensionsImpl.cpp | 2 +- .../extensions/iso15118_extensionsImpl.hpp | 4 +- modules/EvseManager/Charger.cpp | 7 +- modules/EvseManager/Charger.hpp | 6 +- modules/EvseManager/ErrorHandling.cpp | 2 +- modules/EvseManager/EvseManager.cpp | 177 +- modules/EvseManager/EvseManager.hpp | 8 +- .../EvseManager/energy_grid/energyImpl.cpp | 2 +- modules/EvseManager/evse/evse_managerImpl.cpp | 8 +- .../EvseV2G/charger/ISO15118_chargerImpl.cpp | 55 +- .../EvseV2G/charger/ISO15118_chargerImpl.hpp | 23 +- modules/EvseV2G/din_server.cpp | 6 +- .../extensions/iso15118_extensionsImpl.cpp | 4 +- .../extensions/iso15118_extensionsImpl.hpp | 4 +- modules/EvseV2G/iso_server.cpp | 14 +- .../tests/ISO15118_chargerImplStub.hpp | 21 +- .../tests/iso15118_extensionsImplStub.hpp | 3 +- modules/EvseV2G/tools.cpp | 17 +- modules/EvseV2G/tools.hpp | 15 +- modules/EvseV2G/v2g_ctx.cpp | 6 +- modules/EvseV2G/v2g_server.cpp | 98 +- .../IsoMux/charger/ISO15118_chargerImpl.cpp | 25 +- .../IsoMux/charger/ISO15118_chargerImpl.hpp | 23 +- .../extensions/iso15118_extensionsImpl.cpp | 2 +- .../extensions/iso15118_extensionsImpl.hpp | 4 +- modules/IsoMux/tools.cpp | 17 +- modules/IsoMux/tools.hpp | 15 +- modules/OCPP/OCPP.cpp | 6 +- modules/OCPP/conversions.cpp | 50 +- modules/OCPP/conversions.hpp | 27 +- modules/OCPP201/OCPP201.cpp | 6 +- modules/OCPP201/conversions.cpp | 28 +- modules/OCPP201/conversions.hpp | 24 +- modules/PyEvJosev/module.py | 24 +- modules/simulation/JsEvManager/index.js | 24 +- types/authorization.yaml | 2 +- types/iso15118.yaml | 1522 +++++++++++++++++ types/iso15118_charger.yaml | 665 ------- types/iso15118_ev.yaml | 72 - 48 files changed, 1971 insertions(+), 1227 deletions(-) create mode 100644 types/iso15118.yaml delete mode 100644 types/iso15118_charger.yaml delete mode 100644 types/iso15118_ev.yaml diff --git a/interfaces/ISO15118_charger.yaml b/interfaces/ISO15118_charger.yaml index 30b81468c..b8bbf7870 100644 --- a/interfaces/ISO15118_charger.yaml +++ b/interfaces/ISO15118_charger.yaml @@ -9,20 +9,20 @@ cmds: Set an ID that uniquely identifies the EVSE and the power outlet the vehicle is connected to type: object - $ref: /iso15118_charger#/EVSEID + $ref: /iso15118#/EVSEID supported_energy_transfer_modes: description: Available energy transfer modes supported by the EVSE type: array items: description: The different energy modes supported by the SECC type: object - $ref: /iso15118_charger#/SupportedEnergyMode + $ref: /iso15118#/SupportedEnergyMode minItems: 1 maxItems: 6 sae_j2847_mode: description: Charger is supporting SAE J2847 V2G/V2H version type: string - $ref: /iso15118_charger#/SaeJ2847BidiMode + $ref: /iso15118#/SaeJ2847BidiMode debug_mode: description: Enable/Disable debug mode type: boolean @@ -34,7 +34,7 @@ cmds: physical_values: description: Set up initial physical values for a AC or DC charging session type: object - $ref: /iso15118_charger#/SetupPhysicalValues + $ref: /iso15118#/SetupPhysicalValues session_setup: description: At each session start this info should be sent to the module. arguments: @@ -44,7 +44,7 @@ cmds: items: description: These are the payment options a SECC offers to the EVCC type: string - $ref: /iso15118_charger#/PaymentOption + $ref: /iso15118#/PaymentOption minItems: 1 maxItems: 2 supported_certificate_service: @@ -123,28 +123,28 @@ cmds: maximum_limits: description: Maximum values (current, power and voltage) the EVSE can deliver type: object - $ref: /iso15118_charger#/DcEvseMaximumLimits + $ref: /iso15118#/DcEvseMaximumLimits update_dc_minimum_limits: description: Update the minimum limits. Call at least once during start up. arguments: minimum_limits: description: Minimum values (current and voltage) the EVSE can deliver type: object - $ref: /iso15118_charger#/DcEvseMinimumLimits + $ref: /iso15118#/DcEvseMinimumLimits update_isolation_status: description: Update the isolation condition arguments: isolation_status: description: Result of the isolation monitoring type: string - $ref: /iso15118_charger#/IsolationStatus + $ref: /iso15118#/IsolationStatus update_dc_present_values: description: Update the present values from the DC powersupply arguments: present_voltage_current: description: Present voltage and current type: object - $ref: /iso15118_charger#/DcEvsePresentVoltageCurrent + $ref: /iso15118#/DcEvsePresentVoltageCurrent update_meter_info: description: Update meter info arguments: @@ -161,7 +161,7 @@ cmds: error: description: The EVSE error enum type: string - $ref: /iso15118_charger#/EvseError + $ref: /iso15118#/EvseError reset_error: description: Reset all errors vars: @@ -212,13 +212,13 @@ vars: selected_payment_option: description: This element is used for indicating the payment type type: string - $ref: /iso15118_charger#/PaymentOption + $ref: /iso15118#/PaymentOption requested_energy_transfer_mode: description: Selected energy transfer mode for charging that is requested by the EVCC. type: string - $ref: /iso15118_charger#/EnergyTransferMode + $ref: /iso15118#/EnergyTransferMode departure_time: description: >- Optional: [RFC3339 UTC] This element is used to indicate when the @@ -279,7 +279,7 @@ vars: dc_ev_status: description: Current status of the EV type: object - $ref: /iso15118_charger#/DcEvStatus + $ref: /iso15118#/DcEvStatus dc_bulk_charging_complete: description: >- Optional: If set to TRUE, the EV indicates that bulk charge (approx. @@ -293,17 +293,17 @@ vars: dc_ev_target_voltage_current: description: Target voltage and current requested by the EV type: object - $ref: /iso15118_charger#/DcEvTargetValues + $ref: /iso15118#/DcEvTargetValues dc_ev_maximum_limits: description: Maximum Values (current, power and voltage) supported and allowed by the EV type: object - $ref: /iso15118_charger#/DcEvMaximumLimits + $ref: /iso15118#/DcEvMaximumLimits dc_ev_remaining_time: description: Estimated or calculated time until bulk and full charge is complete type: object - $ref: /iso15118_charger#/DcEvRemainingTime + $ref: /iso15118#/DcEvRemainingTime dlink_terminate: description: Terminate the data link and become UNMATCHED. type: "null" @@ -318,13 +318,13 @@ vars: Debug_Lite - This request message provides a list of charging protocols supported by the EVCC type: object - $ref: /iso15118_charger#/AppProtocols + $ref: /iso15118#/AppProtocols v2g_messages: description: >- Debug - This element contains all V2G elements and should be used for debug purposes only type: object - $ref: /iso15118_charger#/V2gMessages + $ref: /iso15118#/V2gMessages selected_protocol: description: >- Debug - Contains the selected protocol @@ -333,12 +333,12 @@ vars: description: >- Parameters that may be displayed on the EVSE (Soc, battery capacity) type: object - $ref: /iso15118_charger#/DisplayParameters + $ref: /iso15118#/DisplayParameters d20_dc_dynamic_charge_mode: description: >- The parameters the EVCC offers and sets for dynamic control mode type: object - $ref: /iso15118_charger#/DcChargeDynamicModeValues + $ref: /iso15118#/DcChargeDynamicModeValues dc_ev_present_voltage: description: Present Voltage measured from the EV type: number diff --git a/interfaces/ISO15118_ev.yaml b/interfaces/ISO15118_ev.yaml index ba6d47762..1e8e01682 100644 --- a/interfaces/ISO15118_ev.yaml +++ b/interfaces/ISO15118_ev.yaml @@ -8,7 +8,7 @@ cmds: Selected energy transfer mode for charging that is requested by the EVCC type: string - $ref: /iso15118_ev#/EnergyTransferMode + $ref: /iso15118#/EnergyTransferMode result: description: Returns true if the evcc simulation started type: boolean @@ -23,17 +23,17 @@ cmds: set_dc_params: description: Set the target parameters for a dc charging process arguments: - EV_Parameters: + EvParameters: description: Target parameters for dc charging type: object - $ref: /iso15118_ev#/DC_EVParameters + $ref: /iso15118#/DcEvParameters set_bpt_dc_params: description: Set the bpt parameters for dc charging arguments: - EV_BPT_Parameters: + EvBPTParameters: description: BPT parameters for dc charging type: object - $ref: /iso15118_ev#/DC_EV_BPT_Parameters + $ref: /iso15118#/DcEvBPTParameters enable_sae_j2847_v2g_v2h: description: Enable the SAE J2847 2 V2H V2G vars: diff --git a/interfaces/iso15118_extensions.yaml b/interfaces/iso15118_extensions.yaml index 4f180e350..bfc7489f7 100644 --- a/interfaces/iso15118_extensions.yaml +++ b/interfaces/iso15118_extensions.yaml @@ -9,7 +9,7 @@ cmds: certificate_response: description: The response raw exi stream and the status from the CSMS system type: object - $ref: /iso15118_charger#/ResponseExiStreamStatus + $ref: /iso15118#/ResponseExiStreamStatus vars: iso15118_certificate_request: description: >- @@ -17,4 +17,4 @@ vars: to the currently valid contract of the vehicle. Response will be reported async via set_get_certificate_response type: object - $ref: /iso15118_charger#/RequestExiStreamSchema + $ref: /iso15118#/RequestExiStreamSchema diff --git a/modules/DummyV2G/main/ISO15118_chargerImpl.cpp b/modules/DummyV2G/main/ISO15118_chargerImpl.cpp index 55f3fb6a5..8aeae0d27 100644 --- a/modules/DummyV2G/main/ISO15118_chargerImpl.cpp +++ b/modules/DummyV2G/main/ISO15118_chargerImpl.cpp @@ -13,18 +13,17 @@ void ISO15118_chargerImpl::ready() { } void ISO15118_chargerImpl::handle_setup( - types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { + types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { // your code for cmd setup goes here } -void ISO15118_chargerImpl::handle_set_charging_parameters( - types::iso15118_charger::SetupPhysicalValues& physical_values) { +void ISO15118_chargerImpl::handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) { // your code for cmd set_charging_parameters goes here } -void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, +void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) { // your code for cmd session_setup goes here } @@ -59,22 +58,20 @@ void ISO15118_chargerImpl::handle_update_ac_max_current(double& max_current) { // your code for cmd update_ac_max_current goes here } -void ISO15118_chargerImpl::handle_update_dc_maximum_limits( - types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) { +void ISO15118_chargerImpl::handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) { // your code for cmd update_dc_maximum_limits goes here } -void ISO15118_chargerImpl::handle_update_dc_minimum_limits( - types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) { +void ISO15118_chargerImpl::handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) { // your code for cmd update_dc_minimum_limits goes here } -void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) { +void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) { // your code for cmd update_isolation_status goes here } void ISO15118_chargerImpl::handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) { + types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) { // your code for cmd update_dc_present_values goes here } @@ -82,7 +79,7 @@ void ISO15118_chargerImpl::handle_update_meter_info(types::powermeter::Powermete // your code for cmd update_meter_info goes here } -void ISO15118_chargerImpl::handle_send_error(types::iso15118_charger::EvseError& error) { +void ISO15118_chargerImpl::handle_send_error(types::iso15118::EvseError& error) { // your code for cmd send_error goes here } diff --git a/modules/DummyV2G/main/ISO15118_chargerImpl.hpp b/modules/DummyV2G/main/ISO15118_chargerImpl.hpp index 1b73540d1..9a44f049a 100644 --- a/modules/DummyV2G/main/ISO15118_chargerImpl.hpp +++ b/modules/DummyV2G/main/ISO15118_chargerImpl.hpp @@ -33,12 +33,11 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { protected: // command handler functions (virtual) - virtual void - handle_setup(types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; - virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override; - virtual void handle_session_setup(std::vector& payment_options, + virtual void handle_setup(types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; + virtual void handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) override; + virtual void handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) override; virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status, types::authorization::CertificateStatus& certificate_status) override; @@ -48,13 +47,13 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { virtual void handle_receipt_is_required(bool& receipt_required) override; virtual void handle_stop_charging(bool& stop) override; virtual void handle_update_ac_max_current(double& max_current) override; - virtual void handle_update_dc_maximum_limits(types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) override; - virtual void handle_update_dc_minimum_limits(types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) override; - virtual void handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) override; - virtual void handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) override; + virtual void handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) override; + virtual void handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) override; + virtual void handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) override; + virtual void + handle_update_dc_present_values(types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) override; virtual void handle_update_meter_info(types::powermeter::Powermeter& powermeter) override; - virtual void handle_send_error(types::iso15118_charger::EvseError& error) override; + virtual void handle_send_error(types::iso15118::EvseError& error) override; virtual void handle_reset_error() override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 diff --git a/modules/EvManager/main/car_simulation.cpp b/modules/EvManager/main/car_simulation.cpp index a0de3f33b..0f1593d4e 100644 --- a/modules/EvManager/main/car_simulation.cpp +++ b/modules/EvManager/main/car_simulation.cpp @@ -210,12 +210,12 @@ bool CarSimulation::iso_start_v2g_session(const CmdArguments& arguments, bool th if (energy_mode == constants::AC) { if (three_phases == false) { - r_ev[0]->call_start_charging(types::iso15118_ev::EnergyTransferMode::AC_single_phase_core); + r_ev[0]->call_start_charging(types::iso15118::EnergyTransferMode::AC_single_phase_core); } else { - r_ev[0]->call_start_charging(types::iso15118_ev::EnergyTransferMode::AC_three_phase_core); + r_ev[0]->call_start_charging(types::iso15118::EnergyTransferMode::AC_three_phase_core); } } else if (energy_mode == constants::DC) { - r_ev[0]->call_start_charging(types::iso15118_ev::EnergyTransferMode::DC_extended); + r_ev[0]->call_start_charging(types::iso15118::EnergyTransferMode::DC_extended); } else { return false; } diff --git a/modules/Evse15118D20/charger/ISO15118_chargerImpl.cpp b/modules/Evse15118D20/charger/ISO15118_chargerImpl.cpp index 025b93073..4c1fd33e8 100644 --- a/modules/Evse15118D20/charger/ISO15118_chargerImpl.cpp +++ b/modules/Evse15118D20/charger/ISO15118_chargerImpl.cpp @@ -41,7 +41,7 @@ template <> std::optional convert_from_optional(const std::optional& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { + types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { std::scoped_lock lock(GEL); setup_config.evse_id = evse_id.evse_id; // TODO(SL): Check format for d20 @@ -320,17 +320,17 @@ void ISO15118_chargerImpl::handle_setup( std::vector services; for (const auto& mode : supported_energy_transfer_modes) { - if (mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::AC_single_phase_core || - mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::AC_three_phase_core) { + if (mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::AC_single_phase_core || + mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::AC_three_phase_core) { if (mode.bidirectional) { services.push_back(dt::ServiceCategory::AC_BPT); } else { services.push_back(dt::ServiceCategory::AC); } - } else if (mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::DC_core || - mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::DC_extended || - mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::DC_combo_core || - mode.energy_transfer_mode == types::iso15118_charger::EnergyTransferMode::DC_unique) { + } else if (mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::DC_core || + mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::DC_extended || + mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::DC_combo_core || + mode.energy_transfer_mode == types::iso15118::EnergyTransferMode::DC_unique) { if (mode.bidirectional) { services.push_back(dt::ServiceCategory::DC_BPT); } else { @@ -344,21 +344,20 @@ void ISO15118_chargerImpl::handle_setup( setup_steps_done.set(to_underlying_value(SetupStep::ENERGY_SERVICE)); } -void ISO15118_chargerImpl::handle_set_charging_parameters( - types::iso15118_charger::SetupPhysicalValues& physical_values) { +void ISO15118_chargerImpl::handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) { // your code for cmd set_charging_parameters goes here } -void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, +void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) { std::scoped_lock lock(GEL); std::vector auth_services; for (auto& option : payment_options) { - if (option == types::iso15118_charger::PaymentOption::ExternalPayment) { + if (option == types::iso15118::PaymentOption::ExternalPayment) { auth_services.push_back(dt::Authorization::EIM); - } else if (option == types::iso15118_charger::PaymentOption::Contract) { + } else if (option == types::iso15118::PaymentOption::Contract) { // auth_services.push_back(iso15118::message_20::Authorization::PnC); EVLOG_warning << "Currently Plug&Charge is not supported and ignored"; } @@ -419,8 +418,7 @@ void ISO15118_chargerImpl::handle_update_ac_max_current(double& max_current) { // your code for cmd update_ac_max_current goes here } -void ISO15118_chargerImpl::handle_update_dc_maximum_limits( - types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) { +void ISO15118_chargerImpl::handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) { std::scoped_lock lock(GEL); setup_config.dc_limits.charge_limits.current.max = dt::from_float(maximum_limits.evse_maximum_current_limit); @@ -447,8 +445,7 @@ void ISO15118_chargerImpl::handle_update_dc_maximum_limits( setup_steps_done.set(to_underlying_value(SetupStep::MAX_LIMITS)); } -void ISO15118_chargerImpl::handle_update_dc_minimum_limits( - types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) { +void ISO15118_chargerImpl::handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) { std::scoped_lock lock(GEL); setup_config.dc_limits.charge_limits.current.min = dt::from_float(minimum_limits.evse_minimum_current_limit); @@ -476,12 +473,12 @@ void ISO15118_chargerImpl::handle_update_dc_minimum_limits( setup_steps_done.set(to_underlying_value(SetupStep::MIN_LIMITS)); } -void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) { +void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) { // your code for cmd update_isolation_status goes here } void ISO15118_chargerImpl::handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) { + types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) { float voltage = present_voltage_current.evse_present_voltage; float current = present_voltage_current.evse_present_current.value_or(0); @@ -496,7 +493,7 @@ void ISO15118_chargerImpl::handle_update_meter_info(types::powermeter::Powermete // your code for cmd update_meter_info goes here } -void ISO15118_chargerImpl::handle_send_error(types::iso15118_charger::EvseError& error) { +void ISO15118_chargerImpl::handle_send_error(types::iso15118::EvseError& error) { // your code for cmd send_error goes here } diff --git a/modules/Evse15118D20/charger/ISO15118_chargerImpl.hpp b/modules/Evse15118D20/charger/ISO15118_chargerImpl.hpp index 726ca0bce..ff380f480 100644 --- a/modules/Evse15118D20/charger/ISO15118_chargerImpl.hpp +++ b/modules/Evse15118D20/charger/ISO15118_chargerImpl.hpp @@ -39,12 +39,11 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { protected: // command handler functions (virtual) - virtual void - handle_setup(types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; - virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override; - virtual void handle_session_setup(std::vector& payment_options, + virtual void handle_setup(types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; + virtual void handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) override; + virtual void handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) override; virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status, types::authorization::CertificateStatus& certificate_status) override; @@ -54,13 +53,13 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { virtual void handle_receipt_is_required(bool& receipt_required) override; virtual void handle_stop_charging(bool& stop) override; virtual void handle_update_ac_max_current(double& max_current) override; - virtual void handle_update_dc_maximum_limits(types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) override; - virtual void handle_update_dc_minimum_limits(types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) override; - virtual void handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) override; - virtual void handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) override; + virtual void handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) override; + virtual void handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) override; + virtual void handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) override; + virtual void + handle_update_dc_present_values(types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) override; virtual void handle_update_meter_info(types::powermeter::Powermeter& powermeter) override; - virtual void handle_send_error(types::iso15118_charger::EvseError& error) override; + virtual void handle_send_error(types::iso15118::EvseError& error) override; virtual void handle_reset_error() override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 diff --git a/modules/Evse15118D20/charger/utils.hpp b/modules/Evse15118D20/charger/utils.hpp index b2155c3f5..83368fab0 100644 --- a/modules/Evse15118D20/charger/utils.hpp +++ b/modules/Evse15118D20/charger/utils.hpp @@ -2,7 +2,7 @@ // Copyright Pionix GmbH and Contributors to EVerest #pragma once -#include +#include #include static constexpr auto NUMBER_OF_SETUP_STEPS = 4; @@ -21,10 +21,10 @@ template constexpr auto to_underlying_value(T t) { static_assert(NUMBER_OF_SETUP_STEPS == to_underlying_value(SetupStep::MIN_LIMITS) + 1, "NUMBER_OF_SETUP_STEPS should be in sync with the SetupStep enum definition"); -constexpr types::iso15118_charger::V2gMessageId convert_v2g_message_type(iso15118::message_20::Type type) { +constexpr types::iso15118::V2gMessageId convert_v2g_message_type(iso15118::message_20::Type type) { using Type = iso15118::message_20::Type; - using Id = types::iso15118_charger::V2gMessageId; + using Id = types::iso15118::V2gMessageId; switch (type) { case Type::None: diff --git a/modules/Evse15118D20/extensions/iso15118_extensionsImpl.cpp b/modules/Evse15118D20/extensions/iso15118_extensionsImpl.cpp index 0b1e38c3c..a1dec9c59 100644 --- a/modules/Evse15118D20/extensions/iso15118_extensionsImpl.cpp +++ b/modules/Evse15118D20/extensions/iso15118_extensionsImpl.cpp @@ -13,7 +13,7 @@ void iso15118_extensionsImpl::ready() { } void iso15118_extensionsImpl::handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) { + types::iso15118::ResponseExiStreamStatus& certificate_response) { // your code for cmd set_get_certificate_response goes here } diff --git a/modules/Evse15118D20/extensions/iso15118_extensionsImpl.hpp b/modules/Evse15118D20/extensions/iso15118_extensionsImpl.hpp index 730834c68..05542bae9 100644 --- a/modules/Evse15118D20/extensions/iso15118_extensionsImpl.hpp +++ b/modules/Evse15118D20/extensions/iso15118_extensionsImpl.hpp @@ -33,8 +33,8 @@ class iso15118_extensionsImpl : public iso15118_extensionsImplBase { protected: // command handler functions (virtual) - virtual void handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) override; + virtual void + handle_set_get_certificate_response(types::iso15118::ResponseExiStreamStatus& certificate_response) override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 // insert your protected definitions here diff --git a/modules/EvseManager/Charger.cpp b/modules/EvseManager/Charger.cpp index 8e205ad76..ad7536d87 100644 --- a/modules/EvseManager/Charger.cpp +++ b/modules/EvseManager/Charger.cpp @@ -287,7 +287,7 @@ void Charger::run_state_machine() { // If we have zero power, some cars will not like the ChargingParameter message. if (config_context.charge_mode == ChargeMode::DC) { // Create a copy of the atomic struct - types::iso15118_charger::DcEvseMaximumLimits evse_limit = shared_context.current_evse_max_limits; + types::iso15118::DcEvseMaximumLimits evse_limit = shared_context.current_evse_max_limits; if (not(evse_limit.evse_maximum_current_limit > 0 and evse_limit.evse_maximum_power_limit > 0)) { if (not internal_context.no_energy_warning_printed) { EVLOG_warning << "No energy available, still retrying..."; @@ -1735,14 +1735,13 @@ void Charger::notify_currentdemand_started() { } } -void Charger::inform_new_evse_max_hlc_limits( - const types::iso15118_charger::DcEvseMaximumLimits& _currentEvseMaxLimits) { +void Charger::inform_new_evse_max_hlc_limits(const types::iso15118::DcEvseMaximumLimits& _currentEvseMaxLimits) { Everest::scoped_lock_timeout lock(state_machine_mutex, Everest::MutexDescription::Charger_inform_new_evse_max_hlc_limits); shared_context.current_evse_max_limits = _currentEvseMaxLimits; } -types::iso15118_charger::DcEvseMaximumLimits Charger::get_evse_max_hlc_limits() { +types::iso15118::DcEvseMaximumLimits Charger::get_evse_max_hlc_limits() { Everest::scoped_lock_timeout lock(state_machine_mutex, Everest::MutexDescription::Charger_get_evse_max_hlc_limits); return shared_context.current_evse_max_limits; } diff --git a/modules/EvseManager/Charger.hpp b/modules/EvseManager/Charger.hpp index 6b6918059..eb40e3060 100644 --- a/modules/EvseManager/Charger.hpp +++ b/modules/EvseManager/Charger.hpp @@ -182,8 +182,8 @@ class Charger { EvseState get_current_state(); sigslot::signal signal_state; - void inform_new_evse_max_hlc_limits(const types::iso15118_charger::DcEvseMaximumLimits& l); - types::iso15118_charger::DcEvseMaximumLimits get_evse_max_hlc_limits(); + void inform_new_evse_max_hlc_limits(const types::iso15118::DcEvseMaximumLimits& l); + types::iso15118::DcEvseMaximumLimits get_evse_max_hlc_limits(); void dlink_pause(); void dlink_error(); @@ -277,7 +277,7 @@ class Charger { bool iec_allow_close_contactor{false}; bool hlc_charging_active{false}; HlcTerminatePause hlc_charging_terminate_pause; - types::iso15118_charger::DcEvseMaximumLimits current_evse_max_limits; + types::iso15118::DcEvseMaximumLimits current_evse_max_limits; bool pwm_running{false}; std::optional stop_transaction_id_token; // only set in case transaction was stopped locally diff --git a/modules/EvseManager/ErrorHandling.cpp b/modules/EvseManager/ErrorHandling.cpp index f27b4920f..8dd7244a5 100644 --- a/modules/EvseManager/ErrorHandling.cpp +++ b/modules/EvseManager/ErrorHandling.cpp @@ -186,7 +186,7 @@ void ErrorHandling::raise_inoperative_error(const std::string& caused_by) { } if (r_hlc.size() > 0) { - r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_EmergencyShutdown); + r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); } // raise externally diff --git a/modules/EvseManager/EvseManager.cpp b/modules/EvseManager/EvseManager.cpp index f485934e5..4dde67b38 100644 --- a/modules/EvseManager/EvseManager.cpp +++ b/modules/EvseManager/EvseManager.cpp @@ -187,20 +187,20 @@ void EvseManager::ready() { if (get_hlc_enabled()) { // Set up EVSE ID - types::iso15118_charger::EVSEID evseid = {config.evse_id, config.evse_id_din}; + types::iso15118::EVSEID evseid = {config.evse_id, config.evse_id_din}; // Set up auth options for HLC - std::vector payment_options; + std::vector payment_options; if (config.payment_enable_eim) { - payment_options.push_back(types::iso15118_charger::PaymentOption::ExternalPayment); + payment_options.push_back(types::iso15118::PaymentOption::ExternalPayment); } if (config.payment_enable_contract) { - payment_options.push_back(types::iso15118_charger::PaymentOption::Contract); + payment_options.push_back(types::iso15118::PaymentOption::Contract); } if (config.payment_enable_eim == false and config.payment_enable_contract == false) { EVLOG_warning << "Both payment options are disabled! ExternalPayment is nevertheless enabled in this case."; - payment_options.push_back(types::iso15118_charger::PaymentOption::ExternalPayment); + payment_options.push_back(types::iso15118::PaymentOption::ExternalPayment); } r_hlc[0]->call_session_setup(payment_options, config.payment_enable_contract); @@ -245,12 +245,12 @@ void EvseManager::ready() { // Ask HLC to stop charging session charger->signal_hlc_stop_charging.connect([this] { r_hlc[0]->call_stop_charging(true); }); - auto sae_mode = types::iso15118_charger::SaeJ2847BidiMode::None; + auto sae_mode = types::iso15118::SaeJ2847BidiMode::None; // Set up energy transfer modes for HLC. For now we only support either DC or AC, not both at the same time. - std::vector transfer_modes; + std::vector transfer_modes; if (config.charge_mode == "AC") { - types::iso15118_charger::SetupPhysicalValues setup_physical_values; + types::iso15118::SetupPhysicalValues setup_physical_values; setup_physical_values.ac_nominal_voltage = config.ac_nominal_voltage; r_hlc[0]->call_set_charging_parameters(setup_physical_values); @@ -258,21 +258,21 @@ void EvseManager::ready() { // FIXME: we cannot change this during run time at the moment. Refactor ISO interface to exclude transfer // modes from setup - // transfer_modes.push_back(types::iso15118_charger::EnergyTransferMode::AC_single_phase_core); - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::AC_three_phase_core, support_bidi}); + // transfer_modes.push_back(types::iso15118::EnergyTransferMode::AC_single_phase_core); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::AC_three_phase_core, support_bidi}); } else if (config.charge_mode == "DC") { - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_extended, false}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_extended, false}); const auto caps = get_powersupply_capabilities(); update_powersupply_capabilities(caps); if (caps.bidirectional) { - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_extended, true}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_extended, true}); } // Set present measurements on HLC to sane defaults - types::iso15118_charger::DcEvsePresentVoltageCurrent present_values; + types::iso15118::DcEvsePresentVoltageCurrent present_values; present_values.evse_present_voltage = 0; present_values.evse_present_current = 0; r_hlc[0]->call_update_dc_present_values(present_values); @@ -312,7 +312,7 @@ void EvseManager::ready() { if (charger->get_current_state() == Charger::EvseState::Charging and not check_isolation_resistance_in_range(m.resistance_F_Ohm)) { charger->set_hlc_error(); - r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_EmergencyShutdown); + r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); } isolation_measurement = m; }); @@ -327,7 +327,7 @@ void EvseManager::ready() { if (not r_powersupply_DC.empty()) { r_powersupply_DC[0]->subscribe_voltage_current([this](types::power_supply_DC::VoltageCurrent m) { powersupply_measurement = m; - types::iso15118_charger::DcEvsePresentVoltageCurrent present_values; + types::iso15118::DcEvsePresentVoltageCurrent present_values; present_values.evse_present_voltage = (m.voltage_V > 0 ? m.voltage_V : 0.0); if (config.sae_j2847_2_bpt_enabled) { present_values.evse_present_current = m.current_A; @@ -360,7 +360,7 @@ void EvseManager::ready() { } // Car requests a target voltage and current limit - r_hlc[0]->subscribe_dc_ev_target_voltage_current([this](types::iso15118_charger::DcEvTargetValues v) { + r_hlc[0]->subscribe_dc_ev_target_voltage_current([this](types::iso15118::DcEvTargetValues v) { bool target_changed = false; // Hack for Skoda Enyaq that should be fixed in a different way @@ -402,47 +402,46 @@ void EvseManager::ready() { } }); - r_hlc[0]->subscribe_d20_dc_dynamic_charge_mode( - [this](types::iso15118_charger::DcChargeDynamicModeValues values) { - constexpr auto PRE_CHARGE_MAX_POWER = 800.0f; + r_hlc[0]->subscribe_d20_dc_dynamic_charge_mode([this](types::iso15118::DcChargeDynamicModeValues values) { + constexpr auto PRE_CHARGE_MAX_POWER = 800.0f; - bool target_changed{false}; + bool target_changed{false}; - if (values.min_voltage > latest_target_voltage) { - latest_target_voltage = values.min_voltage + 10; // TODO(sl): Check if okay - target_changed = true; - } - if (values.max_voltage < latest_target_voltage) { - latest_target_voltage = values.max_voltage - 10; // TODO(sl): Check if okay - target_changed = true; - } + if (values.min_voltage > latest_target_voltage) { + latest_target_voltage = values.min_voltage + 10; // TODO(sl): Check if okay + target_changed = true; + } + if (values.max_voltage < latest_target_voltage) { + latest_target_voltage = values.max_voltage - 10; // TODO(sl): Check if okay + target_changed = true; + } - const double latest_target_power = latest_target_voltage * latest_target_current; + const double latest_target_power = latest_target_voltage * latest_target_current; - if (latest_target_power <= PRE_CHARGE_MAX_POWER or values.min_charge_power > latest_target_power or - values.max_charge_power < latest_target_power) { - latest_target_current = static_cast(values.max_charge_power) / latest_target_voltage; - if (values.max_charge_current < latest_target_current) { - latest_target_current = values.max_charge_current; - } - target_changed = true; + if (latest_target_power <= PRE_CHARGE_MAX_POWER or values.min_charge_power > latest_target_power or + values.max_charge_power < latest_target_power) { + latest_target_current = static_cast(values.max_charge_power) / latest_target_voltage; + if (values.max_charge_current < latest_target_current) { + latest_target_current = values.max_charge_current; } + target_changed = true; + } - if (target_changed) { - apply_new_target_voltage_current(); - if (not contactor_open) { - powersupply_DC_on(); - } - - { - Everest::scoped_lock_timeout lock(ev_info_mutex, - Everest::MutexDescription::EVSE_publish_ev_info); - ev_info.target_voltage = latest_target_voltage; - ev_info.target_current = latest_target_current; - p_evse->publish_ev_info(ev_info); - } + if (target_changed) { + apply_new_target_voltage_current(); + if (not contactor_open) { + powersupply_DC_on(); } - }); + + { + Everest::scoped_lock_timeout lock(ev_info_mutex, + Everest::MutexDescription::EVSE_publish_ev_info); + ev_info.target_voltage = latest_target_voltage; + ev_info.target_current = latest_target_current; + p_evse->publish_ev_info(ev_info); + } + } + }); // Car requests DC contactor open. We don't actually open but switch off DC supply. // opening will be done by Charger on C->B CP event. @@ -461,7 +460,7 @@ void EvseManager::ready() { // Current demand has finished - switch off DC supply r_hlc[0]->subscribe_current_demand_finished([this] { powersupply_DC_off(); }); - r_hlc[0]->subscribe_dc_ev_maximum_limits([this](types::iso15118_charger::DcEvMaximumLimits l) { + r_hlc[0]->subscribe_dc_ev_maximum_limits([this](types::iso15118::DcEvMaximumLimits l) { EVLOG_info << "Received EV maximum limits: " << l; Everest::scoped_lock_timeout lock(ev_info_mutex, Everest::MutexDescription::EVSE_subscribe_dc_ev_maximum_limits); @@ -539,7 +538,7 @@ void EvseManager::ready() { p_evse->publish_ev_info(ev_info); }); - r_hlc[0]->subscribe_dc_ev_remaining_time([this](types::iso15118_charger::DcEvRemainingTime t) { + r_hlc[0]->subscribe_dc_ev_remaining_time([this](types::iso15118::DcEvRemainingTime t) { // FIXME send only on change / throttle messages Everest::scoped_lock_timeout lock(ev_info_mutex, Everest::MutexDescription::EVSE_subscribe_dc_ev_remaining_time); @@ -548,7 +547,7 @@ void EvseManager::ready() { p_evse->publish_ev_info(ev_info); }); - r_hlc[0]->subscribe_dc_ev_status([this](types::iso15118_charger::DcEvStatus s) { + r_hlc[0]->subscribe_dc_ev_status([this](types::iso15118::DcEvStatus s) { // FIXME send only on change / throttle messages Everest::scoped_lock_timeout lock(ev_info_mutex, Everest::MutexDescription::EVSE_subscribe_dc_ev_status); @@ -559,7 +558,7 @@ void EvseManager::ready() { // SAE J2847/2 Bidi if (config.sae_j2847_2_bpt_enabled == true) { - sae_mode = types::iso15118_charger::string_to_sae_j2847bidi_mode(config.sae_j2847_2_bpt_mode); + sae_mode = types::iso15118::string_to_sae_j2847bidi_mode(config.sae_j2847_2_bpt_mode); r_hlc[0]->subscribe_sae_bidi_mode_active([this] { sae_bidi_active = true; @@ -661,7 +660,7 @@ void EvseManager::ready() { // Install debug V2G Messages handler if session logging is enabled if (config.session_logging) { r_hlc[0]->subscribe_v2g_messages( - [this](types::iso15118_charger::V2gMessages v2g_messages) { log_v2g_message(v2g_messages); }); + [this](types::iso15118::V2gMessages v2g_messages) { log_v2g_message(v2g_messages); }); r_hlc[0]->subscribe_selected_protocol( [this](std::string selected_protocol) { this->selected_protocol = selected_protocol; }); @@ -678,7 +677,7 @@ void EvseManager::ready() { charger->signal_ac_with_soc_timeout.connect([this]() { switch_DC_mode(); }); - r_hlc[0]->subscribe_dc_ev_status([this](types::iso15118_charger::DcEvStatus status) { + r_hlc[0]->subscribe_dc_ev_status([this](types::iso15118::DcEvStatus status) { EVLOG_info << fmt::format("SoC received: {}.", status.dc_ev_ress_soc); switch_AC_mode(); }); @@ -843,19 +842,19 @@ void EvseManager::ready() { p_evse->publish_ev_info(ev_info); } - std::vector payment_options; + std::vector payment_options; if (get_hlc_enabled() and s == types::evse_manager::SessionEventEnum::SessionFinished) { if (config.payment_enable_eim) { - payment_options.push_back(types::iso15118_charger::PaymentOption::ExternalPayment); + payment_options.push_back(types::iso15118::PaymentOption::ExternalPayment); } if (config.payment_enable_contract) { - payment_options.push_back(types::iso15118_charger::PaymentOption::Contract); + payment_options.push_back(types::iso15118::PaymentOption::Contract); } if (config.payment_enable_eim == false and config.payment_enable_contract == false) { EVLOG_warning << "Both payment options are disabled! ExternalPayment is nevertheless enabled in this case."; - payment_options.push_back(types::iso15118_charger::PaymentOption::ExternalPayment); + payment_options.push_back(types::iso15118::PaymentOption::ExternalPayment); } r_hlc[0]->call_session_setup(payment_options, config.payment_enable_contract); } @@ -868,10 +867,10 @@ void EvseManager::ready() { ev_info = types::evse_manager::EVInfo(); p_evse->publish_ev_info(ev_info); - std::vector payment_options; + std::vector payment_options; if (get_hlc_enabled() and start_reason == types::evse_manager::StartSessionReason::Authorized) { - payment_options.push_back(types::iso15118_charger::PaymentOption::ExternalPayment); + payment_options.push_back(types::iso15118::PaymentOption::ExternalPayment); r_hlc[0]->call_session_setup(payment_options, false); } }); @@ -1078,35 +1077,35 @@ void EvseManager::setup_fake_DC_mode() { config.switch_3ph1ph_cp_state, config.soft_over_current_timeout_ms, config.state_F_after_fault_ms, config.fail_on_powermeter_errors); - types::iso15118_charger::EVSEID evseid = {config.evse_id, config.evse_id_din}; + types::iso15118::EVSEID evseid = {config.evse_id, config.evse_id_din}; // Set up energy transfer modes for HLC. For now we only support either DC or AC, not both at the same time. - std::vector transfer_modes; + std::vector transfer_modes; constexpr auto support_bidi = false; - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_core, support_bidi}); - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_extended, support_bidi}); - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_combo_core, support_bidi}); - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::DC_unique, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_core, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_extended, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_combo_core, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::DC_unique, support_bidi}); - types::iso15118_charger::DcEvsePresentVoltageCurrent present_values; + types::iso15118::DcEvsePresentVoltageCurrent present_values; present_values.evse_present_voltage = 400; // FIXME: set a correct values present_values.evse_present_current = 0; r_hlc[0]->call_update_dc_present_values(present_values); - types::iso15118_charger::DcEvseMaximumLimits evse_max_limits; + types::iso15118::DcEvseMaximumLimits evse_max_limits; evse_max_limits.evse_maximum_current_limit = 400; evse_max_limits.evse_maximum_power_limit = 200000; evse_max_limits.evse_maximum_voltage_limit = 1000; r_hlc[0]->call_update_dc_maximum_limits(evse_max_limits); - types::iso15118_charger::DcEvseMinimumLimits evse_min_limits; + types::iso15118::DcEvseMinimumLimits evse_min_limits; evse_min_limits.evse_minimum_current_limit = 0; evse_min_limits.evse_minimum_voltage_limit = 0; r_hlc[0]->call_update_dc_minimum_limits(evse_min_limits); - constexpr auto sae_mode = types::iso15118_charger::SaeJ2847BidiMode::None; + constexpr auto sae_mode = types::iso15118::SaeJ2847BidiMode::None; r_hlc[0]->call_setup(evseid, transfer_modes, sae_mode, config.session_logging); } @@ -1118,21 +1117,21 @@ void EvseManager::setup_AC_mode() { config.switch_3ph1ph_cp_state, config.soft_over_current_timeout_ms, config.state_F_after_fault_ms, config.fail_on_powermeter_errors); - types::iso15118_charger::EVSEID evseid = {config.evse_id, config.evse_id_din}; + types::iso15118::EVSEID evseid = {config.evse_id, config.evse_id_din}; // Set up energy transfer modes for HLC. For now we only support either DC or AC, not both at the same time. - std::vector transfer_modes; + std::vector transfer_modes; constexpr auto support_bidi = false; - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::AC_single_phase_core, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::AC_single_phase_core, support_bidi}); if (get_hw_capabilities().max_phase_count_import == 3) { - transfer_modes.push_back({types::iso15118_charger::EnergyTransferMode::AC_three_phase_core, support_bidi}); + transfer_modes.push_back({types::iso15118::EnergyTransferMode::AC_three_phase_core, support_bidi}); } - types::iso15118_charger::SetupPhysicalValues setup_physical_values; + types::iso15118::SetupPhysicalValues setup_physical_values; - constexpr auto sae_mode = types::iso15118_charger::SaeJ2847BidiMode::None; + constexpr auto sae_mode = types::iso15118::SaeJ2847BidiMode::None; if (get_hlc_enabled()) { r_hlc[0]->call_setup(evseid, transfer_modes, sae_mode, config.session_logging); @@ -1140,8 +1139,8 @@ void EvseManager::setup_AC_mode() { } void EvseManager::setup_v2h_mode() { - types::iso15118_charger::DcEvseMaximumLimits evse_max_limits; - types::iso15118_charger::DcEvseMinimumLimits evse_min_limits; + types::iso15118::DcEvseMaximumLimits evse_max_limits; + types::iso15118::DcEvseMinimumLimits evse_min_limits; if (powersupply_capabilities.max_import_current_A.has_value() and powersupply_capabilities.max_import_power_W.has_value() and @@ -1335,9 +1334,9 @@ bool EvseManager::get_hlc_waiting_for_auth_pnc() { return hlc_waiting_for_auth_pnc; } -void EvseManager::log_v2g_message(types::iso15118_charger::V2gMessages v2g_messages) { +void EvseManager::log_v2g_message(types::iso15118::V2gMessages v2g_messages) { - const std::string msg = types::iso15118_charger::v2g_message_id_to_string(v2g_messages.id); + const std::string msg = types::iso15118::v2g_message_id_to_string(v2g_messages.id); const std::string xml = v2g_messages.xml.value_or(""); const std::string json_str = v2g_messages.v2g_json.value_or(""); const std::string exi_hex = v2g_messages.exi.value_or(""); @@ -1398,11 +1397,11 @@ bool EvseManager::cable_check_should_exit() { bool EvseManager::check_isolation_resistance_in_range(double resistance) { if (resistance < CABLECHECK_INSULATION_FAULT_RESISTANCE_OHM) { session_log.evse(false, fmt::format("Isolation measurement FAULT R_F {}.", resistance)); - r_hlc[0]->call_update_isolation_status(types::iso15118_charger::IsolationStatus::Fault); + r_hlc[0]->call_update_isolation_status(types::iso15118::IsolationStatus::Fault); return false; } else { session_log.evse(false, fmt::format("Isolation measurement Ok R_F {}.", resistance)); - r_hlc[0]->call_update_isolation_status(types::iso15118_charger::IsolationStatus::Valid); + r_hlc[0]->call_update_isolation_status(types::iso15118::IsolationStatus::Valid); } return true; } @@ -1412,7 +1411,7 @@ void EvseManager::cable_check() { if (r_imd.empty()) { // If no IMD is connected, we skip isolation checking. EVLOG_info << "No IMD: skipping cable check."; - r_hlc[0]->call_update_isolation_status(types::iso15118_charger::IsolationStatus::No_IMD); + r_hlc[0]->call_update_isolation_status(types::iso15118::IsolationStatus::No_IMD); r_hlc[0]->call_cable_check_finished(true); return; } @@ -1583,7 +1582,7 @@ void EvseManager::cable_check() { } } else { // If no measurements are needed after self test, report valid isolation status to ISO stack - r_hlc[0]->call_update_isolation_status(types::iso15118_charger::IsolationStatus::Valid); + r_hlc[0]->call_update_isolation_status(types::iso15118::IsolationStatus::Valid); } // We are done with the isolation measurement and can now report success to the EV, @@ -1754,7 +1753,7 @@ bool EvseManager::wait_powersupply_DC_voltage_reached(double target_voltage) { powersupply_DC_off(); r_hlc[0]->call_cable_check_finished(false); charger->set_hlc_error(); - r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_EmergencyShutdown); + r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); break; } types::power_supply_DC::VoltageCurrent m; @@ -1785,7 +1784,7 @@ bool EvseManager::wait_powersupply_DC_below_voltage(double target_voltage) { powersupply_DC_off(); r_hlc[0]->call_cable_check_finished(false); charger->set_hlc_error(); - r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_EmergencyShutdown); + r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); break; } types::power_supply_DC::VoltageCurrent m; @@ -1859,7 +1858,7 @@ void EvseManager::fail_cable_check() { r_hlc[0]->call_cable_check_finished(false); } charger->set_hlc_error(); - r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_EmergencyShutdown); + r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); } types::evse_manager::EVInfo EvseManager::get_ev_info() { diff --git a/modules/EvseManager/EvseManager.hpp b/modules/EvseManager/EvseManager.hpp index 0a2728ff8..9a4606ae5 100644 --- a/modules/EvseManager/EvseManager.hpp +++ b/modules/EvseManager/EvseManager.hpp @@ -229,13 +229,13 @@ class EvseManager : public Everest::ModuleBase { powersupply_capabilities = caps; // Inform HLC layer about update of physical values - types::iso15118_charger::SetupPhysicalValues setup_physical_values; + types::iso15118::SetupPhysicalValues setup_physical_values; setup_physical_values.dc_current_regulation_tolerance = powersupply_capabilities.current_regulation_tolerance_A; setup_physical_values.dc_peak_current_ripple = powersupply_capabilities.peak_current_ripple_A; setup_physical_values.dc_energy_to_be_delivered = 10000; r_hlc[0]->call_set_charging_parameters(setup_physical_values); - types::iso15118_charger::DcEvseMinimumLimits evse_min_limits; + types::iso15118::DcEvseMinimumLimits evse_min_limits; evse_min_limits.evse_minimum_current_limit = powersupply_capabilities.min_export_current_A; evse_min_limits.evse_minimum_voltage_limit = powersupply_capabilities.min_export_voltage_V; evse_min_limits.evse_minimum_power_limit = @@ -249,7 +249,7 @@ class EvseManager : public Everest::ModuleBase { // limits are not yet included in request. // Inform charger about new max limits - types::iso15118_charger::DcEvseMaximumLimits evse_max_limits; + types::iso15118::DcEvseMaximumLimits evse_max_limits; evse_max_limits.evse_maximum_current_limit = powersupply_capabilities.max_export_current_A; evse_max_limits.evse_maximum_power_limit = powersupply_capabilities.max_export_power_W; evse_max_limits.evse_maximum_voltage_limit = powersupply_capabilities.max_export_voltage_V; @@ -303,7 +303,7 @@ class EvseManager : public Everest::ModuleBase { types::authorization::ProvidedIdToken autocharge_token; - void log_v2g_message(types::iso15118_charger::V2gMessages v2g_messages); + void log_v2g_message(types::iso15118::V2gMessages v2g_messages); // Reservations bool reserved; diff --git a/modules/EvseManager/energy_grid/energyImpl.cpp b/modules/EvseManager/energy_grid/energyImpl.cpp index af290e864..be8872b21 100644 --- a/modules/EvseManager/energy_grid/energyImpl.cpp +++ b/modules/EvseManager/energy_grid/energyImpl.cpp @@ -488,7 +488,7 @@ void energyImpl::handle_enforce_limits(types::energy::EnforcedLimits& value) { auto powersupply_capabilities = mod->get_powersupply_capabilities(); // tell car our new limits - types::iso15118_charger::DcEvseMaximumLimits evse_max_limits; + types::iso15118::DcEvseMaximumLimits evse_max_limits; if (target_voltage > 10) { // we use target_voltage here to calculate current limit. diff --git a/modules/EvseManager/evse/evse_managerImpl.cpp b/modules/EvseManager/evse/evse_managerImpl.cpp index 28eeae655..d78ef4e95 100644 --- a/modules/EvseManager/evse/evse_managerImpl.cpp +++ b/modules/EvseManager/evse/evse_managerImpl.cpp @@ -80,8 +80,7 @@ void evse_managerImpl::init() { mod->mqtt.subscribe(fmt::format("everest_external/nodered/{}/cmd/emergency_stop", mod->config.connector_id), [this](const std::string& data) { if (mod->get_hlc_enabled()) { - mod->r_hlc[0]->call_send_error( - types::iso15118_charger::EvseError::Error_EmergencyShutdown); + mod->r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_EmergencyShutdown); } types::evse_manager::StopTransactionRequest request; request.reason = types::evse_manager::StopTransactionReason::EmergencyStop; @@ -91,7 +90,7 @@ void evse_managerImpl::init() { mod->mqtt.subscribe(fmt::format("everest_external/nodered/{}/cmd/evse_malfunction", mod->config.connector_id), [this](const std::string& data) { if (mod->get_hlc_enabled()) { - mod->r_hlc[0]->call_send_error(types::iso15118_charger::EvseError::Error_Malfunction); + mod->r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_Malfunction); } types::evse_manager::StopTransactionRequest request; request.reason = types::evse_manager::StopTransactionReason::Other; @@ -101,8 +100,7 @@ void evse_managerImpl::init() { mod->mqtt.subscribe(fmt::format("everest_external/nodered/{}/cmd/evse_utility_int", mod->config.connector_id), [this](const std::string& data) { if (mod->get_hlc_enabled()) { - mod->r_hlc[0]->call_send_error( - types::iso15118_charger::EvseError::Error_UtilityInterruptEvent); + mod->r_hlc[0]->call_send_error(types::iso15118::EvseError::Error_UtilityInterruptEvent); } types::evse_manager::StopTransactionRequest request; request.reason = types::evse_manager::StopTransactionReason::Other; diff --git a/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp b/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp index 6d48c279a..7ab41ff5c 100644 --- a/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp +++ b/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp @@ -8,7 +8,7 @@ const std::string CERTS_SUB_DIR = "certs"; // relativ path of the certs using namespace std::chrono_literals; -using BidiMode = types::iso15118_charger::SaeJ2847BidiMode; +using BidiMode = types::iso15118::SaeJ2847BidiMode; namespace module { namespace charger { @@ -67,9 +67,9 @@ void ISO15118_chargerImpl::ready() { } void ISO15118_chargerImpl::handle_setup( - types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { + types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { uint8_t len = evse_id.evse_id.length(); if (len < iso2_EVSEID_CHARACTER_SIZE) { @@ -97,31 +97,31 @@ void ISO15118_chargerImpl::handle_setup( } switch (mode.energy_transfer_mode) { - case types::iso15118_charger::EnergyTransferMode::AC_single_phase_core: + case types::iso15118::EnergyTransferMode::AC_single_phase_core: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_AC_single_phase_core; v2g_ctx->is_dc_charger = false; break; - case types::iso15118_charger::EnergyTransferMode::AC_three_phase_core: + case types::iso15118::EnergyTransferMode::AC_three_phase_core: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_AC_three_phase_core; v2g_ctx->is_dc_charger = false; break; - case types::iso15118_charger::EnergyTransferMode::DC_core: + case types::iso15118::EnergyTransferMode::DC_core: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_DC_core; break; - case types::iso15118_charger::EnergyTransferMode::DC_extended: + case types::iso15118::EnergyTransferMode::DC_extended: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_DC_extended; break; - case types::iso15118_charger::EnergyTransferMode::DC_combo_core: + case types::iso15118::EnergyTransferMode::DC_combo_core: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_DC_combo_core; break; - case types::iso15118_charger::EnergyTransferMode::DC_unique: + case types::iso15118::EnergyTransferMode::DC_unique: energyArray[(energyArrayLen)++] = iso2_EnergyTransferModeType_DC_unique; break; default: if (energyArrayLen == 0) { dlog(DLOG_LEVEL_WARNING, "Unable to configure SupportedEnergyTransferMode %s", - types::iso15118_charger::energy_transfer_mode_to_string(mode.energy_transfer_mode).c_str()); + types::iso15118::energy_transfer_mode_to_string(mode.energy_transfer_mode).c_str()); } break; } @@ -163,7 +163,7 @@ void ISO15118_chargerImpl::handle_setup( } } -void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, +void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) { if (v2g_ctx->hlc_pause_active != true) { @@ -171,17 +171,17 @@ void ISO15118_chargerImpl::handle_session_setup(std::vectorevse_v2g_data.payment_option_list[v2g_ctx->evse_v2g_data.payment_option_list_len] = iso2_paymentOptionType_Contract; v2g_ctx->evse_v2g_data.payment_option_list_len++; - } else if (option == types::iso15118_charger::PaymentOption::ExternalPayment) { + } else if (option == types::iso15118::PaymentOption::ExternalPayment) { v2g_ctx->evse_v2g_data.payment_option_list[v2g_ctx->evse_v2g_data.payment_option_list_len] = iso2_paymentOptionType_ExternalPayment; v2g_ctx->evse_v2g_data.payment_option_list_len++; } else if (v2g_ctx->evse_v2g_data.payment_option_list_len == 0) { dlog(DLOG_LEVEL_WARNING, "Unable to configure PaymentOptions %s", - types::iso15118_charger::payment_option_to_string(option).c_str()); + types::iso15118::payment_option_to_string(option).c_str()); } } } @@ -289,8 +289,7 @@ void ISO15118_chargerImpl::handle_stop_charging(bool& stop) { } } -void ISO15118_chargerImpl::handle_set_charging_parameters( - types::iso15118_charger::SetupPhysicalValues& physical_values) { +void ISO15118_chargerImpl::handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) { if (physical_values.ac_nominal_voltage.has_value()) { populate_physical_value_float(&v2g_ctx->evse_v2g_data.evse_nominal_voltage, @@ -320,8 +319,7 @@ void ISO15118_chargerImpl::handle_update_ac_max_current(double& max_current) { v2g_ctx->basic_config.evse_ac_current_limit = max_current; } -void ISO15118_chargerImpl::handle_update_dc_maximum_limits( - types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) { +void ISO15118_chargerImpl::handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) { if (maximum_limits.evse_maximum_current_limit > 300.) { populate_physical_value_float(&v2g_ctx->evse_v2g_data.evse_maximum_current_limit, maximum_limits.evse_maximum_current_limit, 1, iso2_unitSymbolType_A); @@ -340,8 +338,7 @@ void ISO15118_chargerImpl::handle_update_dc_maximum_limits( v2g_ctx->evse_v2g_data.evse_maximum_voltage_limit_is_used = 1; } -void ISO15118_chargerImpl::handle_update_dc_minimum_limits( - types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) { +void ISO15118_chargerImpl::handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) { populate_physical_value_float(&v2g_ctx->evse_v2g_data.evse_minimum_current_limit, static_cast(minimum_limits.evse_minimum_current_limit), 1, @@ -351,13 +348,13 @@ void ISO15118_chargerImpl::handle_update_dc_minimum_limits( iso2_unitSymbolType_V); } -void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) { +void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) { v2g_ctx->evse_v2g_data.evse_isolation_status = (uint8_t)isolation_status; v2g_ctx->evse_v2g_data.evse_isolation_status_is_used = 1; } void ISO15118_chargerImpl::handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) { + types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) { populate_physical_value_float(&v2g_ctx->evse_v2g_data.evse_present_voltage, present_voltage_current.evse_present_voltage, 1, iso2_unitSymbolType_V); @@ -385,22 +382,22 @@ void ISO15118_chargerImpl::handle_update_meter_info(types::powermeter::Powermete } } -void ISO15118_chargerImpl::handle_send_error(types::iso15118_charger::EvseError& error) { +void ISO15118_chargerImpl::handle_send_error(types::iso15118::EvseError& error) { switch (error) { - case types::iso15118_charger::EvseError::Error_Contactor: + case types::iso15118::EvseError::Error_Contactor: break; - case types::iso15118_charger::EvseError::Error_RCD: + case types::iso15118::EvseError::Error_RCD: v2g_ctx->evse_v2g_data.rcd = 1; break; - case types::iso15118_charger::EvseError::Error_UtilityInterruptEvent: + case types::iso15118::EvseError::Error_UtilityInterruptEvent: memset(v2g_ctx->evse_v2g_data.evse_status_code, (int)iso2_DC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent, sizeof(v2g_ctx->evse_v2g_data.evse_status_code)); break; - case types::iso15118_charger::EvseError::Error_Malfunction: + case types::iso15118::EvseError::Error_Malfunction: memset(v2g_ctx->evse_v2g_data.evse_status_code, (int)iso2_DC_EVSEStatusCodeType_EVSE_Malfunction, sizeof(v2g_ctx->evse_v2g_data.evse_status_code)); break; - case types::iso15118_charger::EvseError::Error_EmergencyShutdown: + case types::iso15118::EvseError::Error_EmergencyShutdown: /* signal changes to possible waiters, according to man page, it never returns an error code */ pthread_mutex_lock(&v2g_ctx->mqtt_lock); v2g_ctx->intl_emergency_shutdown = true; diff --git a/modules/EvseV2G/charger/ISO15118_chargerImpl.hpp b/modules/EvseV2G/charger/ISO15118_chargerImpl.hpp index 5f7ce5109..69e07a93b 100644 --- a/modules/EvseV2G/charger/ISO15118_chargerImpl.hpp +++ b/modules/EvseV2G/charger/ISO15118_chargerImpl.hpp @@ -34,12 +34,11 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { protected: // command handler functions (virtual) - virtual void - handle_setup(types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; - virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override; - virtual void handle_session_setup(std::vector& payment_options, + virtual void handle_setup(types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; + virtual void handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) override; + virtual void handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) override; virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status, types::authorization::CertificateStatus& certificate_status) override; @@ -49,13 +48,13 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { virtual void handle_receipt_is_required(bool& receipt_required) override; virtual void handle_stop_charging(bool& stop) override; virtual void handle_update_ac_max_current(double& max_current) override; - virtual void handle_update_dc_maximum_limits(types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) override; - virtual void handle_update_dc_minimum_limits(types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) override; - virtual void handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) override; - virtual void handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) override; + virtual void handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) override; + virtual void handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) override; + virtual void handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) override; + virtual void + handle_update_dc_present_values(types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) override; virtual void handle_update_meter_info(types::powermeter::Powermeter& powermeter) override; - virtual void handle_send_error(types::iso15118_charger::EvseError& error) override; + virtual void handle_send_error(types::iso15118::EvseError& error) override; virtual void handle_reset_error() override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 diff --git a/modules/EvseV2G/din_server.cpp b/modules/EvseV2G/din_server.cpp index bbea3995e..694b5fdab 100644 --- a/modules/EvseV2G/din_server.cpp +++ b/modules/EvseV2G/din_server.cpp @@ -133,8 +133,8 @@ static void publish_DIN_DcEvStatus(struct v2g_context* ctx, const struct din_DC_ ctx->ev_v2g_data.din_dc_ev_status.EVReady = din_ev_status.EVReady; ctx->ev_v2g_data.din_dc_ev_status.EVRESSSOC = din_ev_status.EVRESSSOC; - types::iso15118_charger::DcEvStatus ev_status; - ev_status.dc_ev_error_code = static_cast(din_ev_status.EVErrorCode); + types::iso15118::DcEvStatus ev_status; + ev_status.dc_ev_error_code = static_cast(din_ev_status.EVErrorCode); ev_status.dc_ev_ready = din_ev_status.EVReady; ev_status.dc_ev_ress_soc = static_cast(din_ev_status.EVRESSSOC); ctx->p_charger->publish_dc_ev_status(ev_status); @@ -176,7 +176,7 @@ static void publish_din_charge_parameter_discovery_req( struct v2g_context* ctx, struct din_ChargeParameterDiscoveryReqType const* const v2g_charge_parameter_discovery_req) { // V2G values that can be published: DC_EVChargeParameter, MaxEntriesSAScheduleTuple - ctx->p_charger->publish_requested_energy_transfer_mode(static_cast( + ctx->p_charger->publish_requested_energy_transfer_mode(static_cast( v2g_charge_parameter_discovery_req->EVRequestedEnergyTransferType)); if (v2g_charge_parameter_discovery_req->DC_EVChargeParameter_isUsed == (unsigned int)1) { diff --git a/modules/EvseV2G/extensions/iso15118_extensionsImpl.cpp b/modules/EvseV2G/extensions/iso15118_extensionsImpl.cpp index 819f31642..b154a346e 100644 --- a/modules/EvseV2G/extensions/iso15118_extensionsImpl.cpp +++ b/modules/EvseV2G/extensions/iso15118_extensionsImpl.cpp @@ -18,13 +18,13 @@ void iso15118_extensionsImpl::ready() { } void iso15118_extensionsImpl::handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) { + types::iso15118::ResponseExiStreamStatus& certificate_response) { pthread_mutex_lock(&v2g_ctx->mqtt_lock); if (certificate_response.exi_response.has_value() and not certificate_response.exi_response.value().empty()) { v2g_ctx->evse_v2g_data.cert_install_res_b64_buffer = std::string(certificate_response.exi_response.value()); } v2g_ctx->evse_v2g_data.cert_install_status = - (certificate_response.status == types::iso15118_charger::Status::Accepted) ? true : false; + (certificate_response.status == types::iso15118::Status::Accepted) ? true : false; pthread_cond_signal(&v2g_ctx->mqtt_cond); /* unlock */ pthread_mutex_unlock(&v2g_ctx->mqtt_lock); diff --git a/modules/EvseV2G/extensions/iso15118_extensionsImpl.hpp b/modules/EvseV2G/extensions/iso15118_extensionsImpl.hpp index 5b09cd1a1..c73a013ac 100644 --- a/modules/EvseV2G/extensions/iso15118_extensionsImpl.hpp +++ b/modules/EvseV2G/extensions/iso15118_extensionsImpl.hpp @@ -34,8 +34,8 @@ class iso15118_extensionsImpl : public iso15118_extensionsImplBase { protected: // command handler functions (virtual) - virtual void handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) override; + virtual void + handle_set_get_certificate_response(types::iso15118::ResponseExiStreamStatus& certificate_response) override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 // insert your protected definitions here diff --git a/modules/EvseV2G/iso_server.cpp b/modules/EvseV2G/iso_server.cpp index 210bee318..9dd4ff08f 100644 --- a/modules/EvseV2G/iso_server.cpp +++ b/modules/EvseV2G/iso_server.cpp @@ -219,8 +219,8 @@ static void publish_DcEvStatus(struct v2g_context* ctx, const struct iso2_DC_EVS ctx->ev_v2g_data.iso2_dc_ev_status.EVReady = iso2_ev_status.EVReady; ctx->ev_v2g_data.iso2_dc_ev_status.EVRESSSOC = iso2_ev_status.EVRESSSOC; - types::iso15118_charger::DcEvStatus ev_status; - ev_status.dc_ev_error_code = static_cast(iso2_ev_status.EVErrorCode); + types::iso15118::DcEvStatus ev_status; + ev_status.dc_ev_error_code = static_cast(iso2_ev_status.EVErrorCode); ev_status.dc_ev_ready = iso2_ev_status.EVReady; ev_status.dc_ev_ress_soc = static_cast(iso2_ev_status.EVRESSSOC); ctx->p_charger->publish_dc_ev_status(ev_status); @@ -282,7 +282,7 @@ static void publish_iso_charge_parameter_discovery_req( struct v2g_context* ctx, struct iso2_ChargeParameterDiscoveryReqType const* const v2g_charge_parameter_discovery_req) { // V2G values that can be published: DC_EVChargeParameter, MaxEntriesSAScheduleTuple - ctx->p_charger->publish_requested_energy_transfer_mode(static_cast( + ctx->p_charger->publish_requested_energy_transfer_mode(static_cast( v2g_charge_parameter_discovery_req->RequestedEnergyTransferMode)); if (v2g_charge_parameter_discovery_req->AC_EVChargeParameter_isUsed == (unsigned int)1) { if (v2g_charge_parameter_discovery_req->AC_EVChargeParameter.DepartureTime_isUsed == (unsigned int)1) { @@ -456,7 +456,7 @@ static bool publish_iso_certificate_installation_exi_req(struct v2g_context* ctx // PnC only bool rv = true; - types::iso15118_charger::RequestExiStreamSchema certificate_request; + types::iso15118::RequestExiStreamSchema certificate_request; #ifdef EVEREST_MBED_TLS /* Parse contract leaf certificate */ @@ -492,7 +492,7 @@ static bool publish_iso_certificate_installation_exi_req(struct v2g_context* ctx #endif // EVEREST_MBED_TLS certificate_request.iso15118_schema_version = ISO_15118_2013_MSG_DEF; - certificate_request.certificate_action = types::iso15118_charger::CertificateActionEnum::Install; + certificate_request.certificate_action = types::iso15118::CertificateActionEnum::Install; ctx->p_extensions->publish_iso15118_certificate_request(certificate_request); #ifdef EVEREST_MBED_TLS @@ -750,7 +750,7 @@ static enum v2g_event handle_iso_payment_service_selection(struct v2g_connection if (conn->ctx->evse_v2g_data.payment_option_list[idx] == req->SelectedPaymentOption) { list_element_found = true; conn->ctx->p_charger->publish_selected_payment_option( - static_cast(req->SelectedPaymentOption)); + static_cast(req->SelectedPaymentOption)); break; } } @@ -931,7 +931,7 @@ static enum v2g_event handle_iso_payment_details(struct v2g_connection* conn) { // Save the certificate chain in a variable in PEM format to publish it std::string contract_cert_chain_pem = chain_to_pem(contract_crt, &chain); - std::optional> iso15118_certificate_hash_data; + std::optional> iso15118_certificate_hash_data; /* Only if certificate chain verification should be done locally by the EVSE */ if (conn->ctx->session.verify_contract_cert_chain == true) { diff --git a/modules/EvseV2G/tests/ISO15118_chargerImplStub.hpp b/modules/EvseV2G/tests/ISO15118_chargerImplStub.hpp index 3a097d045..5f5f7a0bf 100644 --- a/modules/EvseV2G/tests/ISO15118_chargerImplStub.hpp +++ b/modules/EvseV2G/tests/ISO15118_chargerImplStub.hpp @@ -23,16 +23,15 @@ struct ISO15118_chargerImplStub : public ISO15118_chargerImplBase { virtual void ready() { } - virtual void - handle_setup(types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { + virtual void handle_setup(types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { std::cout << "ISO15118_chargerImplBase::handle_setup called" << std::endl; } - virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) { + virtual void handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) { std::cout << "ISO15118_chargerImplBase::handle_set_charging_parameters called" << std::endl; } - virtual void handle_session_setup(std::vector& payment_options, + virtual void handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) { std::cout << "ISO15118_chargerImplBase::handle_session_setup called" << std::endl; } @@ -58,23 +57,23 @@ struct ISO15118_chargerImplStub : public ISO15118_chargerImplBase { virtual void handle_update_ac_max_current(double& max_current) { std::cout << "ISO15118_chargerImplBase::handle_update_ac_max_current called" << std::endl; } - virtual void handle_update_dc_maximum_limits(types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) { + virtual void handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) { std::cout << "ISO15118_chargerImplBase::handle_update_dc_maximum_limits called" << std::endl; } - virtual void handle_update_dc_minimum_limits(types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) { + virtual void handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) { std::cout << "ISO15118_chargerImplBase::handle_update_dc_minimum_limits called" << std::endl; } - virtual void handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) { + virtual void handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) { std::cout << "ISO15118_chargerImplBase::handle_update_isolation_status called" << std::endl; } virtual void - handle_update_dc_present_values(types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) { + handle_update_dc_present_values(types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) { std::cout << "ISO15118_chargerImplBase::handle_update_dc_present_values called" << std::endl; } virtual void handle_update_meter_info(types::powermeter::Powermeter& powermeter) { std::cout << "ISO15118_chargerImplBase::handle_update_meter_info called" << std::endl; } - virtual void handle_send_error(types::iso15118_charger::EvseError& error) { + virtual void handle_send_error(types::iso15118::EvseError& error) { std::cout << "ISO15118_chargerImplBase::handle_send_error called" << std::endl; } virtual void handle_reset_error() { diff --git a/modules/EvseV2G/tests/iso15118_extensionsImplStub.hpp b/modules/EvseV2G/tests/iso15118_extensionsImplStub.hpp index 2e1a8abb1..ab6824e10 100644 --- a/modules/EvseV2G/tests/iso15118_extensionsImplStub.hpp +++ b/modules/EvseV2G/tests/iso15118_extensionsImplStub.hpp @@ -20,8 +20,7 @@ class iso15118_extensionsImplStub : public iso15118_extensionsImplBase { virtual void ready() { } - virtual void - handle_set_get_certificate_response(types::iso15118_charger::ResponseExiStreamStatus& certificate_response) { + virtual void handle_set_get_certificate_response(types::iso15118::ResponseExiStreamStatus& certificate_response) { std::cout << "iso15118_extensionsImplBase::handle_set_get_certificate_response called" << std::endl; } }; diff --git a/modules/EvseV2G/tools.cpp b/modules/EvseV2G/tools.cpp index 85e9a887c..62a35c000 100644 --- a/modules/EvseV2G/tools.cpp +++ b/modules/EvseV2G/tools.cpp @@ -348,27 +348,26 @@ std::string convert_to_hex_str(const uint8_t* data, int len) { return string_stream.str(); } -types::iso15118_charger::HashAlgorithm -convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm) { +types::iso15118::HashAlgorithm convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm) { switch (hash_algorithm) { case types::evse_security::HashAlgorithm::SHA256: - return types::iso15118_charger::HashAlgorithm::SHA256; + return types::iso15118::HashAlgorithm::SHA256; case types::evse_security::HashAlgorithm::SHA384: - return types::iso15118_charger::HashAlgorithm::SHA384; + return types::iso15118::HashAlgorithm::SHA384; case types::evse_security::HashAlgorithm::SHA512: - return types::iso15118_charger::HashAlgorithm::SHA512; + return types::iso15118::HashAlgorithm::SHA512; default: throw std::runtime_error( - "Could not convert types::evse_security::HashAlgorithm to types::iso15118_charger::HashAlgorithm"); + "Could not convert types::evse_security::HashAlgorithm to types::iso15118::HashAlgorithm"); } } -std::vector +std::vector convert_to_certificate_hash_data_info_vector(const types::evse_security::OCSPRequestDataList& ocsp_request_data_list) { - std::vector certificate_hash_data_info_vec; + std::vector certificate_hash_data_info_vec; for (const auto& ocsp_request_data : ocsp_request_data_list.ocsp_request_data_list) { if (ocsp_request_data.responder_url.has_value() and ocsp_request_data.certificate_hash_data.has_value()) { - types::iso15118_charger::CertificateHashDataInfo certificate_hash_data; + types::iso15118::CertificateHashDataInfo certificate_hash_data; certificate_hash_data.hashAlgorithm = convert_to_hash_algorithm(ocsp_request_data.certificate_hash_data.value().hash_algorithm); certificate_hash_data.issuerNameHash = ocsp_request_data.certificate_hash_data.value().issuer_name_hash; diff --git a/modules/EvseV2G/tools.hpp b/modules/EvseV2G/tools.hpp index b9365e233..2b55dd4bd 100644 --- a/modules/EvseV2G/tools.hpp +++ b/modules/EvseV2G/tools.hpp @@ -5,7 +5,7 @@ #define TOOLS_H #include -#include +#include #include #include #include @@ -121,19 +121,18 @@ uint8_t get_dir_numbered_file_names(char file_names[MAX_PKI_CA_LENGTH][MAX_FILE_ std::string convert_to_hex_str(const uint8_t* data, int len); /** - * \brief convert the given \p hash_algorithm to type types::iso15118_charger::HashAlgorithm + * \brief convert the given \p hash_algorithm to type types::iso15118::HashAlgorithm * \param hash_algorithm - * \return types::iso15118_charger::HashAlgorithm + * \return types::iso15118::HashAlgorithm */ -types::iso15118_charger::HashAlgorithm -convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm); +types::iso15118::HashAlgorithm convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm); /** - * \brief convert the given \p ocsp_request_data_list to std::vector + * \brief convert the given \p ocsp_request_data_list to std::vector * \param ocsp_request_data_list - * \return std::vector + * \return std::vector */ -std::vector +std::vector convert_to_certificate_hash_data_info_vector(const types::evse_security::OCSPRequestDataList& ocsp_request_data_list); #endif /* TOOLS_H */ diff --git a/modules/EvseV2G/v2g_ctx.cpp b/modules/EvseV2G/v2g_ctx.cpp index e160859bf..65862999f 100644 --- a/modules/EvseV2G/v2g_ctx.cpp +++ b/modules/EvseV2G/v2g_ctx.cpp @@ -426,7 +426,7 @@ void publish_dc_ev_maximum_limits(struct v2g_context* ctx, const float& v2g_dc_e const unsigned int& v2g_dc_ev_max_power_limit_is_used, const float& v2g_dc_ev_max_voltage_limit, const unsigned int& v2g_dc_ev_max_voltage_limit_is_used) { - types::iso15118_charger::DcEvMaximumLimits dc_ev_maximum_limits; + types::iso15118::DcEvMaximumLimits dc_ev_maximum_limits; bool publish_message = false; if (v2g_dc_ev_max_current_limit_is_used == (unsigned int)1) { @@ -460,7 +460,7 @@ void publish_dc_ev_target_voltage_current(struct v2g_context* ctx, const float& const float& v2g_dc_ev_target_current) { if ((ctx->ev_v2g_data.v2g_target_voltage != v2g_dc_ev_target_voltage) || (ctx->ev_v2g_data.v2g_target_current != v2g_dc_ev_target_current)) { - types::iso15118_charger::DcEvTargetValues dc_ev_target_values; + types::iso15118::DcEvTargetValues dc_ev_target_values; dc_ev_target_values.dc_ev_target_voltage = v2g_dc_ev_target_voltage; dc_ev_target_values.dc_ev_target_current = v2g_dc_ev_target_current; @@ -475,7 +475,7 @@ void publish_dc_ev_remaining_time(struct v2g_context* ctx, const float& v2g_dc_e const unsigned int& v2g_dc_ev_remaining_time_to_full_soc_is_used, const float& v2g_dc_ev_remaining_time_to_bulk_soc, const unsigned int& v2g_dc_ev_remaining_time_to_bulk_soc_is_used) { - types::iso15118_charger::DcEvRemainingTime dc_ev_remaining_time; + types::iso15118::DcEvRemainingTime dc_ev_remaining_time; const char* format = "%Y-%m-%dT%H:%M:%SZ"; char buffer[100]; std::time_t time_now_in_sec = time(NULL); diff --git a/modules/EvseV2G/v2g_server.cpp b/modules/EvseV2G/v2g_server.cpp index 891d147dc..a6dade0dc 100644 --- a/modules/EvseV2G/v2g_server.cpp +++ b/modules/EvseV2G/v2g_server.cpp @@ -30,74 +30,72 @@ #define MAX_RES_TIME 98 -static types::iso15118_charger::V2gMessageId get_v2g_message_id(enum V2gMsgTypeId v2g_msg, - enum v2g_protocol selected_protocol, bool is_req) { +static types::iso15118::V2gMessageId get_v2g_message_id(enum V2gMsgTypeId v2g_msg, enum v2g_protocol selected_protocol, + bool is_req) { switch (v2g_msg) { case V2G_SUPPORTED_APP_PROTOCOL_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::SupportedAppProtocolReq - : types::iso15118_charger::V2gMessageId::SupportedAppProtocolRes; + return is_req == true ? types::iso15118::V2gMessageId::SupportedAppProtocolReq + : types::iso15118::V2gMessageId::SupportedAppProtocolRes; case V2G_SESSION_SETUP_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::SessionSetupReq - : types::iso15118_charger::V2gMessageId::SessionSetupRes; + return is_req == true ? types::iso15118::V2gMessageId::SessionSetupReq + : types::iso15118::V2gMessageId::SessionSetupRes; case V2G_SERVICE_DISCOVERY_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::ServiceDiscoveryReq - : types::iso15118_charger::V2gMessageId::ServiceDiscoveryRes; + return is_req == true ? types::iso15118::V2gMessageId::ServiceDiscoveryReq + : types::iso15118::V2gMessageId::ServiceDiscoveryRes; case V2G_SERVICE_DETAIL_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::ServiceDetailReq - : types::iso15118_charger::V2gMessageId::ServiceDetailRes; + return is_req == true ? types::iso15118::V2gMessageId::ServiceDetailReq + : types::iso15118::V2gMessageId::ServiceDetailRes; case V2G_PAYMENT_SERVICE_SELECTION_MSG: - return is_req == true ? selected_protocol == V2G_PROTO_DIN70121 - ? types::iso15118_charger::V2gMessageId::ServicePaymentSelectionReq - : types::iso15118_charger::V2gMessageId::PaymentServiceSelectionReq - : selected_protocol == V2G_PROTO_DIN70121 - ? types::iso15118_charger::V2gMessageId::ServicePaymentSelectionRes - : types::iso15118_charger::V2gMessageId::PaymentServiceSelectionRes; + return is_req == true ? selected_protocol == V2G_PROTO_DIN70121 + ? types::iso15118::V2gMessageId::ServicePaymentSelectionReq + : types::iso15118::V2gMessageId::PaymentServiceSelectionReq + : selected_protocol == V2G_PROTO_DIN70121 ? types::iso15118::V2gMessageId::ServicePaymentSelectionRes + : types::iso15118::V2gMessageId::PaymentServiceSelectionRes; case V2G_PAYMENT_DETAILS_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::PaymentDetailsReq - : types::iso15118_charger::V2gMessageId::PaymentDetailsRes; + return is_req == true ? types::iso15118::V2gMessageId::PaymentDetailsReq + : types::iso15118::V2gMessageId::PaymentDetailsRes; case V2G_AUTHORIZATION_MSG: - return is_req == true ? selected_protocol == V2G_PROTO_DIN70121 - ? types::iso15118_charger::V2gMessageId::ContractAuthenticationReq - : types::iso15118_charger::V2gMessageId::AuthorizationReq - : selected_protocol == V2G_PROTO_DIN70121 - ? types::iso15118_charger::V2gMessageId::ContractAuthenticationRes - : types::iso15118_charger::V2gMessageId::AuthorizationRes; + return is_req == true ? selected_protocol == V2G_PROTO_DIN70121 + ? types::iso15118::V2gMessageId::ContractAuthenticationReq + : types::iso15118::V2gMessageId::AuthorizationReq + : selected_protocol == V2G_PROTO_DIN70121 ? types::iso15118::V2gMessageId::ContractAuthenticationRes + : types::iso15118::V2gMessageId::AuthorizationRes; case V2G_CHARGE_PARAMETER_DISCOVERY_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::ChargeParameterDiscoveryReq - : types::iso15118_charger::V2gMessageId::ChargeParameterDiscoveryRes; + return is_req == true ? types::iso15118::V2gMessageId::ChargeParameterDiscoveryReq + : types::iso15118::V2gMessageId::ChargeParameterDiscoveryRes; case V2G_METERING_RECEIPT_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::MeteringReceiptReq - : types::iso15118_charger::V2gMessageId::MeteringReceiptRes; + return is_req == true ? types::iso15118::V2gMessageId::MeteringReceiptReq + : types::iso15118::V2gMessageId::MeteringReceiptRes; case V2G_CERTIFICATE_UPDATE_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::CertificateUpdateReq - : types::iso15118_charger::V2gMessageId::CertificateUpdateRes; + return is_req == true ? types::iso15118::V2gMessageId::CertificateUpdateReq + : types::iso15118::V2gMessageId::CertificateUpdateRes; case V2G_CERTIFICATE_INSTALLATION_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::CertificateInstallationReq - : types::iso15118_charger::V2gMessageId::CertificateInstallationRes; + return is_req == true ? types::iso15118::V2gMessageId::CertificateInstallationReq + : types::iso15118::V2gMessageId::CertificateInstallationRes; case V2G_CHARGING_STATUS_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::ChargingStatusReq - : types::iso15118_charger::V2gMessageId::ChargingStatusRes; + return is_req == true ? types::iso15118::V2gMessageId::ChargingStatusReq + : types::iso15118::V2gMessageId::ChargingStatusRes; case V2G_CABLE_CHECK_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::CableCheckReq - : types::iso15118_charger::V2gMessageId::CableCheckRes; + return is_req == true ? types::iso15118::V2gMessageId::CableCheckReq + : types::iso15118::V2gMessageId::CableCheckRes; case V2G_PRE_CHARGE_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::PreChargeReq - : types::iso15118_charger::V2gMessageId::PreChargeRes; + return is_req == true ? types::iso15118::V2gMessageId::PreChargeReq + : types::iso15118::V2gMessageId::PreChargeRes; case V2G_POWER_DELIVERY_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::PowerDeliveryReq - : types::iso15118_charger::V2gMessageId::PowerDeliveryRes; + return is_req == true ? types::iso15118::V2gMessageId::PowerDeliveryReq + : types::iso15118::V2gMessageId::PowerDeliveryRes; case V2G_CURRENT_DEMAND_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::CurrentDemandReq - : types::iso15118_charger::V2gMessageId::CurrentDemandRes; + return is_req == true ? types::iso15118::V2gMessageId::CurrentDemandReq + : types::iso15118::V2gMessageId::CurrentDemandRes; case V2G_WELDING_DETECTION_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::WeldingDetectionReq - : types::iso15118_charger::V2gMessageId::WeldingDetectionRes; + return is_req == true ? types::iso15118::V2gMessageId::WeldingDetectionReq + : types::iso15118::V2gMessageId::WeldingDetectionRes; case V2G_SESSION_STOP_MSG: - return is_req == true ? types::iso15118_charger::V2gMessageId::SessionStopReq - : types::iso15118_charger::V2gMessageId::SessionStopRes; + return is_req == true ? types::iso15118::V2gMessageId::SessionStopReq + : types::iso15118::V2gMessageId::SessionStopRes; case V2G_UNKNOWN_MSG: default: - return types::iso15118_charger::V2gMessageId::UnknownMessage; + return types::iso15118::V2gMessageId::UnknownMessage; } } @@ -107,7 +105,7 @@ static types::iso15118_charger::V2gMessageId get_v2g_message_id(enum V2gMsgTypeI * \param is_req if it is a V2G request or response: 'true' if a request, and 'false' if a response */ static void publish_var_V2G_Message(v2g_connection* conn, bool is_req) { - types::iso15118_charger::V2gMessages v2g_message; + types::iso15118::V2gMessages v2g_message; u_int8_t* tempbuff = conn->buffer; std::string msg_as_hex_string; @@ -264,7 +262,7 @@ static enum v2g_event v2g_handle_apphandshake(struct v2g_connection* conn) { // (e.g. after an unexpected message) } - types::iso15118_charger::AppProtocols app_protocols; // to publish supported app protocol array + types::iso15118::AppProtocols app_protocols; // to publish supported app protocol array for (i = 0; i < conn->handshake_req.supportedAppProtocolReq.AppProtocol.arrayLen; i++) { struct appHand_AppProtocolType* app_proto = &conn->handshake_req.supportedAppProtocolReq.AppProtocol.array[i]; @@ -302,7 +300,7 @@ static enum v2g_event v2g_handle_apphandshake(struct v2g_connection* conn) { } if (conn->ctx->debugMode == true) { - const types::iso15118_charger::AppProtocol protocol = { + const types::iso15118::AppProtocol protocol = { std::string(proto_ns), static_cast(app_proto->VersionNumberMajor), static_cast(app_proto->VersionNumberMinor), static_cast(app_proto->SchemaID), static_cast(app_proto->Priority)}; diff --git a/modules/IsoMux/charger/ISO15118_chargerImpl.cpp b/modules/IsoMux/charger/ISO15118_chargerImpl.cpp index 93c4a8a8c..8452147f7 100644 --- a/modules/IsoMux/charger/ISO15118_chargerImpl.cpp +++ b/modules/IsoMux/charger/ISO15118_chargerImpl.cpp @@ -8,7 +8,7 @@ const std::string CERTS_SUB_DIR = "certs"; // relativ path of the certs using namespace std::chrono_literals; -using BidiMode = types::iso15118_charger::SaeJ2847BidiMode; +using BidiMode = types::iso15118::SaeJ2847BidiMode; namespace module { namespace charger { @@ -460,20 +460,19 @@ void ISO15118_chargerImpl::ready() { } void ISO15118_chargerImpl::handle_setup( - types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { + types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) { mod->r_iso20->call_setup(evse_id, supported_energy_transfer_modes, sae_j2847_mode, debug_mode); mod->r_iso2->call_setup(evse_id, supported_energy_transfer_modes, sae_j2847_mode, debug_mode); } -void ISO15118_chargerImpl::handle_set_charging_parameters( - types::iso15118_charger::SetupPhysicalValues& physical_values) { +void ISO15118_chargerImpl::handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) { mod->r_iso20->call_set_charging_parameters(physical_values); mod->r_iso2->call_set_charging_parameters(physical_values); } -void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, +void ISO15118_chargerImpl::handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) { mod->r_iso20->call_session_setup(payment_options, supported_certificate_service); mod->r_iso2->call_session_setup(payment_options, supported_certificate_service); @@ -531,19 +530,17 @@ void ISO15118_chargerImpl::handle_update_ac_max_current(double& max_current) { mod->r_iso2->call_update_ac_max_current(max_current); } -void ISO15118_chargerImpl::handle_update_dc_maximum_limits( - types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) { +void ISO15118_chargerImpl::handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) { mod->r_iso20->call_update_dc_maximum_limits(maximum_limits); mod->r_iso2->call_update_dc_maximum_limits(maximum_limits); } -void ISO15118_chargerImpl::handle_update_dc_minimum_limits( - types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) { +void ISO15118_chargerImpl::handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) { mod->r_iso20->call_update_dc_minimum_limits(minimum_limits); mod->r_iso2->call_update_dc_minimum_limits(minimum_limits); } -void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) { +void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) { if (mod->selected_iso20()) { mod->r_iso20->call_update_isolation_status(isolation_status); } else { @@ -552,7 +549,7 @@ void ISO15118_chargerImpl::handle_update_isolation_status(types::iso15118_charge } void ISO15118_chargerImpl::handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) { + types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) { mod->r_iso20->call_update_dc_present_values(present_voltage_current); mod->r_iso2->call_update_dc_present_values(present_voltage_current); } @@ -562,7 +559,7 @@ void ISO15118_chargerImpl::handle_update_meter_info(types::powermeter::Powermete mod->r_iso2->call_update_meter_info(powermeter); } -void ISO15118_chargerImpl::handle_send_error(types::iso15118_charger::EvseError& error) { +void ISO15118_chargerImpl::handle_send_error(types::iso15118::EvseError& error) { if (mod->selected_iso20()) { mod->r_iso20->call_send_error(error); } else { diff --git a/modules/IsoMux/charger/ISO15118_chargerImpl.hpp b/modules/IsoMux/charger/ISO15118_chargerImpl.hpp index 0d3c73770..9fcf022a1 100644 --- a/modules/IsoMux/charger/ISO15118_chargerImpl.hpp +++ b/modules/IsoMux/charger/ISO15118_chargerImpl.hpp @@ -34,12 +34,11 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { protected: // command handler functions (virtual) - virtual void - handle_setup(types::iso15118_charger::EVSEID& evse_id, - std::vector& supported_energy_transfer_modes, - types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; - virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override; - virtual void handle_session_setup(std::vector& payment_options, + virtual void handle_setup(types::iso15118::EVSEID& evse_id, + std::vector& supported_energy_transfer_modes, + types::iso15118::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override; + virtual void handle_set_charging_parameters(types::iso15118::SetupPhysicalValues& physical_values) override; + virtual void handle_session_setup(std::vector& payment_options, bool& supported_certificate_service) override; virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status, types::authorization::CertificateStatus& certificate_status) override; @@ -49,13 +48,13 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase { virtual void handle_receipt_is_required(bool& receipt_required) override; virtual void handle_stop_charging(bool& stop) override; virtual void handle_update_ac_max_current(double& max_current) override; - virtual void handle_update_dc_maximum_limits(types::iso15118_charger::DcEvseMaximumLimits& maximum_limits) override; - virtual void handle_update_dc_minimum_limits(types::iso15118_charger::DcEvseMinimumLimits& minimum_limits) override; - virtual void handle_update_isolation_status(types::iso15118_charger::IsolationStatus& isolation_status) override; - virtual void handle_update_dc_present_values( - types::iso15118_charger::DcEvsePresentVoltageCurrent& present_voltage_current) override; + virtual void handle_update_dc_maximum_limits(types::iso15118::DcEvseMaximumLimits& maximum_limits) override; + virtual void handle_update_dc_minimum_limits(types::iso15118::DcEvseMinimumLimits& minimum_limits) override; + virtual void handle_update_isolation_status(types::iso15118::IsolationStatus& isolation_status) override; + virtual void + handle_update_dc_present_values(types::iso15118::DcEvsePresentVoltageCurrent& present_voltage_current) override; virtual void handle_update_meter_info(types::powermeter::Powermeter& powermeter) override; - virtual void handle_send_error(types::iso15118_charger::EvseError& error) override; + virtual void handle_send_error(types::iso15118::EvseError& error) override; virtual void handle_reset_error() override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 diff --git a/modules/IsoMux/extensions/iso15118_extensionsImpl.cpp b/modules/IsoMux/extensions/iso15118_extensionsImpl.cpp index 7e32f7f6d..73762741b 100644 --- a/modules/IsoMux/extensions/iso15118_extensionsImpl.cpp +++ b/modules/IsoMux/extensions/iso15118_extensionsImpl.cpp @@ -30,7 +30,7 @@ void iso15118_extensionsImpl::ready() { } void iso15118_extensionsImpl::handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) { + types::iso15118::ResponseExiStreamStatus& certificate_response) { if (mod->selected_iso20()) { mod->r_ext20->call_set_get_certificate_response(certificate_response); } else { diff --git a/modules/IsoMux/extensions/iso15118_extensionsImpl.hpp b/modules/IsoMux/extensions/iso15118_extensionsImpl.hpp index 63b3113f1..7c631e851 100644 --- a/modules/IsoMux/extensions/iso15118_extensionsImpl.hpp +++ b/modules/IsoMux/extensions/iso15118_extensionsImpl.hpp @@ -33,8 +33,8 @@ class iso15118_extensionsImpl : public iso15118_extensionsImplBase { protected: // command handler functions (virtual) - virtual void handle_set_get_certificate_response( - types::iso15118_charger::ResponseExiStreamStatus& certificate_response) override; + virtual void + handle_set_get_certificate_response(types::iso15118::ResponseExiStreamStatus& certificate_response) override; // ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 // insert your protected definitions here diff --git a/modules/IsoMux/tools.cpp b/modules/IsoMux/tools.cpp index f94db476d..1239aa851 100644 --- a/modules/IsoMux/tools.cpp +++ b/modules/IsoMux/tools.cpp @@ -342,27 +342,26 @@ std::string convert_to_hex_str(const uint8_t* data, int len) { return string_stream.str(); } -types::iso15118_charger::HashAlgorithm -convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm) { +types::iso15118::HashAlgorithm convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm) { switch (hash_algorithm) { case types::evse_security::HashAlgorithm::SHA256: - return types::iso15118_charger::HashAlgorithm::SHA256; + return types::iso15118::HashAlgorithm::SHA256; case types::evse_security::HashAlgorithm::SHA384: - return types::iso15118_charger::HashAlgorithm::SHA384; + return types::iso15118::HashAlgorithm::SHA384; case types::evse_security::HashAlgorithm::SHA512: - return types::iso15118_charger::HashAlgorithm::SHA512; + return types::iso15118::HashAlgorithm::SHA512; default: throw std::runtime_error( - "Could not convert types::evse_security::HashAlgorithm to types::iso15118_charger::HashAlgorithm"); + "Could not convert types::evse_security::HashAlgorithm to types::iso15118::HashAlgorithm"); } } -std::vector +std::vector convert_to_certificate_hash_data_info_vector(const types::evse_security::OCSPRequestDataList& ocsp_request_data_list) { - std::vector certificate_hash_data_info_vec; + std::vector certificate_hash_data_info_vec; for (const auto& ocsp_request_data : ocsp_request_data_list.ocsp_request_data_list) { if (ocsp_request_data.responder_url.has_value() and ocsp_request_data.certificate_hash_data.has_value()) { - types::iso15118_charger::CertificateHashDataInfo certificate_hash_data; + types::iso15118::CertificateHashDataInfo certificate_hash_data; certificate_hash_data.hashAlgorithm = convert_to_hash_algorithm(ocsp_request_data.certificate_hash_data.value().hash_algorithm); certificate_hash_data.issuerNameHash = ocsp_request_data.certificate_hash_data.value().issuer_name_hash; diff --git a/modules/IsoMux/tools.hpp b/modules/IsoMux/tools.hpp index b9365e233..2b55dd4bd 100644 --- a/modules/IsoMux/tools.hpp +++ b/modules/IsoMux/tools.hpp @@ -5,7 +5,7 @@ #define TOOLS_H #include -#include +#include #include #include #include @@ -121,19 +121,18 @@ uint8_t get_dir_numbered_file_names(char file_names[MAX_PKI_CA_LENGTH][MAX_FILE_ std::string convert_to_hex_str(const uint8_t* data, int len); /** - * \brief convert the given \p hash_algorithm to type types::iso15118_charger::HashAlgorithm + * \brief convert the given \p hash_algorithm to type types::iso15118::HashAlgorithm * \param hash_algorithm - * \return types::iso15118_charger::HashAlgorithm + * \return types::iso15118::HashAlgorithm */ -types::iso15118_charger::HashAlgorithm -convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm); +types::iso15118::HashAlgorithm convert_to_hash_algorithm(const types::evse_security::HashAlgorithm hash_algorithm); /** - * \brief convert the given \p ocsp_request_data_list to std::vector + * \brief convert the given \p ocsp_request_data_list to std::vector * \param ocsp_request_data_list - * \return std::vector + * \return std::vector */ -std::vector +std::vector convert_to_certificate_hash_data_info_vector(const types::evse_security::OCSPRequestDataList& ocsp_request_data_list); #endif /* TOOLS_H */ diff --git a/modules/OCPP/OCPP.cpp b/modules/OCPP/OCPP.cpp index dd3300b7d..a7e3e72fa 100644 --- a/modules/OCPP/OCPP.cpp +++ b/modules/OCPP/OCPP.cpp @@ -309,7 +309,7 @@ void OCPP::init_evse_subscriptions() { int32_t extensions_id = 1; for (auto& extension : this->r_extensions_15118) { extension->subscribe_iso15118_certificate_request( - [this, extensions_id](types::iso15118_charger::RequestExiStreamSchema request) { + [this, extensions_id](types::iso15118::RequestExiStreamSchema request) { this->charge_point->data_transfer_pnc_get_15118_ev_certificate( extensions_id, request.exi_request, request.iso15118_schema_version, conversions::to_ocpp_certificate_action_enum(request.certificate_action)); @@ -785,8 +785,8 @@ void OCPP::ready() { this->charge_point->register_get_15118_ev_certificate_response_callback( [this](const int32_t connector_id, const ocpp::v201::Get15118EVCertificateResponse& certificate_response, const ocpp::v201::CertificateActionEnum& certificate_action) { - types::iso15118_charger::ResponseExiStreamStatus response; - response.status = conversions::to_everest_iso15118_charger_status(certificate_response.status); + types::iso15118::ResponseExiStreamStatus response; + response.status = conversions::to_everest_iso15118_status(certificate_response.status); response.certificate_action = conversions::to_everest_certificate_action_enum(certificate_action); if (not certificate_response.exiResponse.get().empty()) { // since exi_response is an optional in the EVerest type we only set it when not empty diff --git a/modules/OCPP/conversions.cpp b/modules/OCPP/conversions.cpp index 07f61a099..1e6276343 100644 --- a/modules/OCPP/conversions.cpp +++ b/modules/OCPP/conversions.cpp @@ -106,16 +106,15 @@ ocpp::v16::Reason to_ocpp_reason(const types::evse_manager::StopTransactionReaso throw std::out_of_range("Could not convert types::evse_manager::StopTransactionReason to ocpp::v16::Reason"); } -ocpp::v201::CertificateActionEnum -to_ocpp_certificate_action_enum(const types::iso15118_charger::CertificateActionEnum action) { +ocpp::v201::CertificateActionEnum to_ocpp_certificate_action_enum(const types::iso15118::CertificateActionEnum action) { switch (action) { - case types::iso15118_charger::CertificateActionEnum::Install: + case types::iso15118::CertificateActionEnum::Install: return ocpp::v201::CertificateActionEnum::Install; - case types::iso15118_charger::CertificateActionEnum::Update: + case types::iso15118::CertificateActionEnum::Update: return ocpp::v201::CertificateActionEnum::Update; } throw std::out_of_range( - "Could not convert types::iso15118_charger::CertificateActionEnum to ocpp::v201::CertificateActionEnum"); + "Could not convert types::iso15118::CertificateActionEnum to ocpp::v201::CertificateActionEnum"); } ocpp::v16::ReservationStatus to_ocpp_reservation_status(const types::reservation::ReservationResult result) { @@ -164,18 +163,16 @@ to_ocpp_update_firmware_status_enum_type(const types::system::UpdateFirmwareResp "Could not convert types::system::UpdateFirmwareResponse to ocpp::v16::UpdateFirmwareStatusEnumType"); } -ocpp::v16::HashAlgorithmEnumType -to_ocpp_hash_algorithm_enum_type(const types::iso15118_charger::HashAlgorithm hash_algorithm) { +ocpp::v16::HashAlgorithmEnumType to_ocpp_hash_algorithm_enum_type(const types::iso15118::HashAlgorithm hash_algorithm) { switch (hash_algorithm) { - case types::iso15118_charger::HashAlgorithm::SHA256: + case types::iso15118::HashAlgorithm::SHA256: return ocpp::v16::HashAlgorithmEnumType::SHA256; - case types::iso15118_charger::HashAlgorithm::SHA384: + case types::iso15118::HashAlgorithm::SHA384: return ocpp::v16::HashAlgorithmEnumType::SHA384; - case types::iso15118_charger::HashAlgorithm::SHA512: + case types::iso15118::HashAlgorithm::SHA512: return ocpp::v16::HashAlgorithmEnumType::SHA512; } - throw std::out_of_range( - "Could not convert types::iso15118_charger::HashAlgorithm to ocpp::v16::HashAlgorithmEnumType"); + throw std::out_of_range("Could not convert types::iso15118::HashAlgorithm to ocpp::v16::HashAlgorithmEnumType"); } ocpp::v16::BootReasonEnum to_ocpp_boot_reason_enum(const types::system::BootReason reason) { @@ -258,17 +255,16 @@ std::vector to_ocpp_temperatures(const std::vector -#include +#include #include #include #include @@ -36,10 +36,9 @@ ocpp::v16::DataTransferStatus to_ocpp_data_transfer_status(const types::ocpp::Da /// \brief Converts a given types::evse_manager::StopTransactionReason \p reason to a ocpp::v16::Reason. ocpp::v16::Reason to_ocpp_reason(const types::evse_manager::StopTransactionReason reason); -/// \brief Converts a given types::iso15118_charger::CertificateActionEnum \p action to a +/// \brief Converts a given types::iso15118::CertificateActionEnum \p action to a /// ocpp::v201::CertificateActionEnum. -ocpp::v201::CertificateActionEnum -to_ocpp_certificate_action_enum(const types::iso15118_charger::CertificateActionEnum action); +ocpp::v201::CertificateActionEnum to_ocpp_certificate_action_enum(const types::iso15118::CertificateActionEnum action); /// \brief Converts a given types::reservation::ReservationResult \p result to a ocpp::v16::ReservationStatus. ocpp::v16::ReservationStatus to_ocpp_reservation_status(const types::reservation::ReservationResult result); @@ -52,12 +51,11 @@ ocpp::v16::LogStatusEnumType to_ocpp_log_status_enum_type(const types::system::U ocpp::v16::UpdateFirmwareStatusEnumType to_ocpp_update_firmware_status_enum_type(const types::system::UpdateFirmwareResponse response); -/// \brief Converts a given types::iso15118_charger::HashAlgorithm \p hash_algorithm to a +/// \brief Converts a given types::iso15118::HashAlgorithm \p hash_algorithm to a /// ocpp::v16::HashAlgorithmEnumType. -ocpp::v16::HashAlgorithmEnumType -to_ocpp_hash_algorithm_enum_type(const types::iso15118_charger::HashAlgorithm hash_algorithm); +ocpp::v16::HashAlgorithmEnumType to_ocpp_hash_algorithm_enum_type(const types::iso15118::HashAlgorithm hash_algorithm); -/// \brief Converts a given types::iso15118_charger::Status \p status to a ocpp::v201::Iso15118EVCertificateStatusEnum. +/// \brief Converts a given types::iso15118::Status \p status to a ocpp::v201::Iso15118EVCertificateStatusEnum. ocpp::v16::BootReasonEnum to_ocpp_boot_reason_enum(const types::system::BootReason reason); /// \brief Converts a given types::powermeter::Powermeter \p powermeter to a ocpp::Powermeter @@ -66,8 +64,8 @@ ocpp::Powermeter to_ocpp_power_meter(const types::powermeter::Powermeter& powerm /// \brief Converts a given vector of types::temperature::Temperature \p powermeter to a vector of ocpp::Temperature std::vector to_ocpp_temperatures(const std::vector& temperatures); -/// \brief Converts a given types::iso15118_charger::HashAlgorithm \p hash_algorithm to a ocpp::v201::HashAlgorithmEnum. -ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118_charger::HashAlgorithm hash_algorithm); +/// \brief Converts a given types::iso15118::HashAlgorithm \p hash_algorithm to a ocpp::v201::HashAlgorithmEnum. +ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118::HashAlgorithm hash_algorithm); /// \brief Converts a given ocpp::v16::Reason \p reason to a types::evse_manager::StopTransactionReason. types::evse_manager::StopTransactionReason to_everest_stop_transaction_reason(const ocpp::v16::Reason reason); @@ -75,13 +73,12 @@ types::evse_manager::StopTransactionReason to_everest_stop_transaction_reason(co /// \brief Converts a given ocpp::v16::ResetType \p type to a types::system::ResetType. types::system::ResetType to_everest_reset_type(const ocpp::v16::ResetType type); -/// \brief Converts a given ocpp::v201::Iso15118EVCertificateStatusEnum \p status to a types::iso15118_charger::Status. -types::iso15118_charger::Status -to_everest_iso15118_charger_status(const ocpp::v201::Iso15118EVCertificateStatusEnum status); +/// \brief Converts a given ocpp::v201::Iso15118EVCertificateStatusEnum \p status to a types::iso15118::Status. +types::iso15118::Status to_everest_iso15118_status(const ocpp::v201::Iso15118EVCertificateStatusEnum status); /// \brief Converts a given ocpp::v201::CertificateActionEnum \p action to a -/// types::iso15118_charger::CertificateActionEnum. -types::iso15118_charger::CertificateActionEnum +/// types::iso15118::CertificateActionEnum. +types::iso15118::CertificateActionEnum to_everest_certificate_action_enum(const ocpp::v201::CertificateActionEnum action); /// \brief Converts a given ocpp::v201::AuthorizeCertificateStatusEnum \p status to a diff --git a/modules/OCPP201/OCPP201.cpp b/modules/OCPP201/OCPP201.cpp index 3cd0a7d7f..501598725 100644 --- a/modules/OCPP201/OCPP201.cpp +++ b/modules/OCPP201/OCPP201.cpp @@ -855,13 +855,13 @@ void OCPP201::ready() { int32_t extensions_id = 0; for (auto& extension : this->r_extensions_15118) { extension->subscribe_iso15118_certificate_request( - [this, extensions_id](const types::iso15118_charger::RequestExiStreamSchema& certificate_request) { + [this, extensions_id](const types::iso15118::RequestExiStreamSchema& certificate_request) { auto ocpp_response = this->charge_point->on_get_15118_ev_certificate_request( conversions::to_ocpp_get_15118_certificate_request(certificate_request)); EVLOG_debug << "Received response from get_15118_ev_certificate_request: " << ocpp_response; // transform response, inject action, send to associated EvseManager - types::iso15118_charger::ResponseExiStreamStatus everest_response; - everest_response.status = conversions::to_everest_iso15118_charger_status(ocpp_response.status); + types::iso15118::ResponseExiStreamStatus everest_response; + everest_response.status = conversions::to_everest_iso15118_status(ocpp_response.status); everest_response.certificate_action = certificate_request.certificate_action; if (not ocpp_response.exiResponse.get().empty()) { // since exi_response is an optional in the EVerest type we only set it when not empty diff --git a/modules/OCPP201/conversions.cpp b/modules/OCPP201/conversions.cpp index ecfaf1ae8..b0a3376b1 100644 --- a/modules/OCPP201/conversions.cpp +++ b/modules/OCPP201/conversions.cpp @@ -654,11 +654,11 @@ ocpp::v201::IdToken to_ocpp_id_token(const types::authorization::IdToken& id_tok } ocpp::v201::CertificateActionEnum -to_ocpp_certificate_action_enum(const types::iso15118_charger::CertificateActionEnum& action) { +to_ocpp_certificate_action_enum(const types::iso15118::CertificateActionEnum& action) { switch (action) { - case types::iso15118_charger::CertificateActionEnum::Install: + case types::iso15118::CertificateActionEnum::Install: return ocpp::v201::CertificateActionEnum::Install; - case types::iso15118_charger::CertificateActionEnum::Update: + case types::iso15118::CertificateActionEnum::Update: return ocpp::v201::CertificateActionEnum::Update; } throw std::out_of_range("Could not convert CertificateActionEnum"); // this should never happen @@ -710,7 +710,7 @@ to_everest_stop_transaction_reason(const ocpp::v201::ReasonEnum& stop_reason) { } std::vector to_ocpp_ocsp_request_data_vector( - const std::vector& certificate_hash_data_info) { + const std::vector& certificate_hash_data_info) { std::vector ocsp_request_data_list; for (const auto& certificate_hash_data : certificate_hash_data_info) { @@ -725,17 +725,16 @@ std::vector to_ocpp_ocsp_request_data_vector( return ocsp_request_data_list; } -ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118_charger::HashAlgorithm hash_algorithm) { +ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118::HashAlgorithm hash_algorithm) { switch (hash_algorithm) { - case types::iso15118_charger::HashAlgorithm::SHA256: + case types::iso15118::HashAlgorithm::SHA256: return ocpp::v201::HashAlgorithmEnum::SHA256; - case types::iso15118_charger::HashAlgorithm::SHA384: + case types::iso15118::HashAlgorithm::SHA384: return ocpp::v201::HashAlgorithmEnum::SHA384; - case types::iso15118_charger::HashAlgorithm::SHA512: + case types::iso15118::HashAlgorithm::SHA512: return ocpp::v201::HashAlgorithmEnum::SHA512; } - throw std::out_of_range( - "Could not convert types::iso15118_charger::HashAlgorithm to ocpp::v201::HashAlgorithmEnum"); + throw std::out_of_range("Could not convert types::iso15118::HashAlgorithm to ocpp::v201::HashAlgorithmEnum"); } std::vector @@ -819,7 +818,7 @@ ocpp::v201::AttributeEnum to_ocpp_attribute_enum(const types::ocpp::AttributeEnu } ocpp::v201::Get15118EVCertificateRequest -to_ocpp_get_15118_certificate_request(const types::iso15118_charger::RequestExiStreamSchema& request) { +to_ocpp_get_15118_certificate_request(const types::iso15118::RequestExiStreamSchema& request) { ocpp::v201::Get15118EVCertificateRequest _request; _request.iso15118SchemaVersion = request.iso15118_schema_version; _request.exiRequest = request.exi_request; @@ -899,13 +898,12 @@ to_everest_firmware_update_request(const ocpp::v201::UpdateFirmwareRequest& requ return _request; } -types::iso15118_charger::Status -to_everest_iso15118_charger_status(const ocpp::v201::Iso15118EVCertificateStatusEnum& status) { +types::iso15118::Status to_everest_iso15118_status(const ocpp::v201::Iso15118EVCertificateStatusEnum& status) { switch (status) { case ocpp::v201::Iso15118EVCertificateStatusEnum::Accepted: - return types::iso15118_charger::Status::Accepted; + return types::iso15118::Status::Accepted; case ocpp::v201::Iso15118EVCertificateStatusEnum::Failed: - return types::iso15118_charger::Status::Failed; + return types::iso15118::Status::Failed; } throw std::out_of_range("Could not convert Iso15118EVCertificateStatusEnum"); // this should never happen } diff --git a/modules/OCPP201/conversions.hpp b/modules/OCPP201/conversions.hpp index 053dbf021..68c490f0a 100644 --- a/modules/OCPP201/conversions.hpp +++ b/modules/OCPP201/conversions.hpp @@ -4,7 +4,7 @@ #define OCPP_V201_CONVERSIONS_HPP #include -#include +#include #include #include #include @@ -82,19 +82,18 @@ ocpp::v201::IdTokenEnum to_ocpp_id_token_enum(types::authorization::IdTokenType /// \brief Converts a given types::authorization::IdToken \p id_token to an ocpp::v201::IdToken. ocpp::v201::IdToken to_ocpp_id_token(const types::authorization::IdToken& id_token); -/// \brief Converts a given types::iso15118_charger::CertificateActionEnum \p action to an +/// \brief Converts a given types::iso15118::CertificateActionEnum \p action to an /// ocpp::v201::CertificateActionEnum. -ocpp::v201::CertificateActionEnum -to_ocpp_certificate_action_enum(const types::iso15118_charger::CertificateActionEnum& action); +ocpp::v201::CertificateActionEnum to_ocpp_certificate_action_enum(const types::iso15118::CertificateActionEnum& action); -/// \brief Converts a vector of types::iso15118_charger::CertificateHashDataInfo to a vector of +/// \brief Converts a vector of types::iso15118::CertificateHashDataInfo to a vector of /// ocpp::v201::OCSPRequestData. std::vector to_ocpp_ocsp_request_data_vector( - const std::vector& certificate_hash_data_info); + const std::vector& certificate_hash_data_info); -/// \brief Converts a given types::iso15118_charger::HashAlgorithm \p hash_algorithm to an +/// \brief Converts a given types::iso15118::HashAlgorithm \p hash_algorithm to an /// ocpp::v201::HashAlgorithmEnum. -ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118_charger::HashAlgorithm hash_algorithm); +ocpp::v201::HashAlgorithmEnum to_ocpp_hash_algorithm_enum(const types::iso15118::HashAlgorithm hash_algorithm); /// \brief Converts a given types::ocpp::GetVariableRequest \p get_variable_request_vector to an /// std::vector @@ -118,10 +117,10 @@ ocpp::v201::EVSE to_ocpp_evse(const types::ocpp::EVSE& evse); /// \brief Converts a given types::ocpp::AttributeEnum to ocpp::v201::AttributeEnum ocpp::v201::AttributeEnum to_ocpp_attribute_enum(const types::ocpp::AttributeEnum attribute_enum); -/// \brief Converts a given types::types::iso15118_charger::RequestExiStreamSchema to +/// \brief Converts a given types::types::iso15118::RequestExiStreamSchema to /// ocpp::v201::Get15118EVCertificateRequest ocpp::v201::Get15118EVCertificateRequest -to_ocpp_get_15118_certificate_request(const types::iso15118_charger::RequestExiStreamSchema& request); +to_ocpp_get_15118_certificate_request(const types::iso15118::RequestExiStreamSchema& request); /// \brief Converts a given types::reservation::ReservationResult to ocpp::v201::ReserveNowStatusEnum ocpp::v201::ReserveNowStatusEnum to_ocpp_reservation_status(const types::reservation::ReservationResult result); @@ -143,9 +142,8 @@ types::system::UploadLogsRequest to_everest_upload_logs_request(const ocpp::v201 types::system::FirmwareUpdateRequest to_everest_firmware_update_request(const ocpp::v201::UpdateFirmwareRequest& request); -/// \brief Converts a given ocpp::v201::Iso15118EVCertificateStatusEnum \p status to a types::iso15118_charger::Status. -types::iso15118_charger::Status -to_everest_iso15118_charger_status(const ocpp::v201::Iso15118EVCertificateStatusEnum& status); +/// \brief Converts a given ocpp::v201::Iso15118EVCertificateStatusEnum \p status to a types::iso15118::Status. +types::iso15118::Status to_everest_iso15118_status(const ocpp::v201::Iso15118EVCertificateStatusEnum& status); /// \brief Converts a given ocpp::v201::DataTransferStatusEnum \p status to a types::ocpp::DataTransferStatus. types::ocpp::DataTransferStatus to_everest_data_transfer_status(ocpp::v201::DataTransferStatusEnum status); diff --git a/modules/PyEvJosev/module.py b/modules/PyEvJosev/module.py index fabc388db..2ad87ebdf 100644 --- a/modules/PyEvJosev/module.py +++ b/modules/PyEvJosev/module.py @@ -111,20 +111,20 @@ def _handler_set_fault(self, args): pass def _handler_set_dc_params(self, args): - parameters = args['EV_Parameters'] - self._es.dc_max_current_limit = parameters['MaxCurrentLimit'] - self._es.dc_max_power_limit = parameters['MaxPowerLimit'] - self._es.dc_max_voltage_limit = parameters['MaxVoltageLimit'] - self._es.dc_energy_capacity = parameters['EnergyCapacity'] - self._es.dc_target_current = parameters['TargetCurrent'] - self._es.dc_target_voltage = parameters['TargetVoltage'] + parameters = args['EvParameters'] + self._es.dc_max_current_limit = parameters['max_current_limit'] + self._es.dc_max_power_limit = parameters['max_power_limit'] + self._es.dc_max_voltage_limit = parameters['max_voltage_limit'] + self._es.dc_energy_capacity = parameters['energy_capacity'] + self._es.dc_target_current = parameters['target_current'] + self._es.dc_target_voltage = parameters['target_voltage'] def _handler_set_bpt_dc_params(self, args): - parameters = args['EV_BPT_Parameters'] - self._es.dc_discharge_max_current_limit = parameters["DischargeMaxCurrentLimit"] - self._es.dc_discharge_max_power_limit = parameters['DischargeMaxPowerLimit'] - self._es.dc_discharge_target_current = parameters['DischargeTargetCurrent'] - self._es.minimal_soc = parameters["DischargeMinimalSoC"] + parameters = args['EvBPTParameters'] + self._es.dc_discharge_max_current_limit = parameters["discharge_max_current_limit"] + self._es.dc_discharge_max_power_limit = parameters['discharge_max_power_limit'] + self._es.dc_discharge_target_current = parameters['discharge_target_current'] + self._es.minimal_soc = parameters["discharge_minimal_soC"] def _handler_enable_sae_j2847_v2g_v2h(self, args): self._es.SAEJ2847_V2H_V2G_Active = True diff --git a/modules/simulation/JsEvManager/index.js b/modules/simulation/JsEvManager/index.js index 8268ff970..1263984d8 100644 --- a/modules/simulation/JsEvManager/index.js +++ b/modules/simulation/JsEvManager/index.js @@ -473,24 +473,24 @@ function registerAllCmds(mod) { function get_hlc_dc_parameters(mod) { return { - EV_Parameters: { - MaxCurrentLimit: mod.config.module.dc_max_current_limit, - MaxPowerLimit: mod.config.module.dc_max_power_limit, - MaxVoltageLimit: mod.config.module.dc_max_voltage_limit, - EnergyCapacity: mod.config.module.dc_energy_capacity, - TargetCurrent: mod.config.module.dc_target_current, - TargetVoltage: mod.config.module.dc_target_voltage, + EvParameters: { + max_current_limit: mod.config.module.dc_max_current_limit, + max_power_limit: mod.config.module.dc_max_power_limit, + max_voltage_limit: mod.config.module.dc_max_voltage_limit, + energy_capacity: mod.config.module.dc_energy_capacity, + target_current: mod.config.module.dc_target_current, + target_voltage: mod.config.module.dc_target_voltage, }, }; } function get_hlc_bpt_dc_parameters(mod) { return { - EV_BPT_Parameters: { - DischargeMaxCurrentLimit: mod.config.module.dc_discharge_max_current_limit, - DischargeMaxPowerLimit: mod.config.module.dc_discharge_max_power_limit, - DischargeTargetCurrent: mod.config.module.dc_discharge_target_current, - DischargeMinimalSoC: mod.config.module.dc_discharge_v2g_minimal_soc, + EvBPTParameters: { + discharge_max_current_limit: mod.config.module.dc_discharge_max_current_limit, + discharge_max_power_limit: mod.config.module.dc_discharge_max_power_limit, + discharge_target_current: mod.config.module.dc_discharge_target_current, + discharge_minimal_soC: mod.config.module.dc_discharge_v2g_minimal_soc, }, }; } diff --git a/types/authorization.yaml b/types/authorization.yaml index db548bfdf..2b0e16b24 100644 --- a/types/authorization.yaml +++ b/types/authorization.yaml @@ -123,7 +123,7 @@ types: items: description: An array of contract certificate infos type: object - $ref: /iso15118_charger#/CertificateHashDataInfo + $ref: /iso15118#/CertificateHashDataInfo minItems: 1 maxItems: 4 TokenValidationStatusMessage: diff --git a/types/iso15118.yaml b/types/iso15118.yaml new file mode 100644 index 000000000..eb5ec235b --- /dev/null +++ b/types/iso15118.yaml @@ -0,0 +1,1522 @@ +description: ISO15118 charger types +types: + PaymentOption: + description: Payment options for the SECC and EVCC + type: string + enum: + - Contract + - ExternalPayment + EnergyTransferMode: + description: >- + Possible energy transfer modes. The modes AC_single_phase_core to DC_unique apply to DIN70121 and ISO15118-2. + The other modes DC to WPT apply to ISO15118-20. + type: string + enum: + - AC_single_phase_core + - AC_two_phase + - AC_three_phase_core + - DC_core + - DC_extended + - DC_combo_core + - DC_unique + - DC + - AC_BPT + - AC_BPT_DER + - AC_DER + - DC_BPT + - DC_ACDP + - DC_ACDP_BPT + - WPT + IsolationStatus: + description: The different charger isolation status + type: string + enum: + - Invalid + - Valid + - Warning + - Fault + - No_IMD + DcEvErrorCode: + description: Indicates the DC EV internal status + type: string + enum: + - NO_ERROR + - FAILED_RESSTemperatureInhibit + - FAILED_EVShiftPosition + - FAILED_ChargerConnectorLockFault + - FAILED_EVRESSMalfunction + - FAILED_ChargingCurrentdifferential + - FAILED_ChargingVoltageOutOfRange + - Reserved_A + - Reserved_B + - Reserved_C + - FAILED_ChargingSystemIncompatibility + - NoData + EvseError: + description: >- + Details on error type + Error_Contactor: The contactor is opened or closed at the wrong moment. + Error_RCD: The RCD has detected an error. + Error_UtilityInterruptEvent: Utility Interrupt Event, Utility or Equipment operator has requested a temporary reduction in load + Error_Malfunction: A non-recoverable charger fault has occurred (Isolation Failure, ...). It is permanently faulted. + Error_EmergencyShutdown: Charging System Incompatibility, Emergency Shutdown or E-Stop button pressed at charging station + type: string + enum: + - Error_Contactor + - Error_RCD + - Error_UtilityInterruptEvent + - Error_Malfunction + - Error_EmergencyShutdown + V2gMessageId: + description: This element contains the id of the v2g message body + type: string + enum: + - SupportedAppProtocolReq + - SupportedAppProtocolRes + - SessionSetupReq + - SessionSetupRes + - ServiceDiscoveryReq + - ServiceDiscoveryRes + - ServiceDetailReq + - ServiceDetailRes + - PaymentServiceSelectionReq + - PaymentServiceSelectionRes + - ServicePaymentSelectionReq + - ServicePaymentSelectionRes + - PaymentDetailsReq + - PaymentDetailsRes + - AuthorizationReq + - AuthorizationRes + - ContractAuthenticationReq + - ContractAuthenticationRes + - ChargeParameterDiscoveryReq + - ChargeParameterDiscoveryRes + - ChargingStatusReq + - ChargingStatusRes + - MeteringReceiptReq + - MeteringReceiptRes + - PowerDeliveryReq + - PowerDeliveryRes + - CableCheckReq + - CableCheckRes + - PreChargeReq + - PreChargeRes + - CurrentDemandReq + - CurrentDemandRes + - WeldingDetectionReq + - WeldingDetectionRes + - SessionStopReq + - SessionStopRes + - CertificateInstallationReq + - CertificateInstallationRes + - CertificateUpdateReq + - CertificateUpdateRes + - AuthorizationSetupReq + - AuthorizationSetupRes + - ScheduleExchangeReq + - ScheduleExchangeRes + - ServiceSelectionReq + - ServiceSelectionRes + - AcChargeLoopReq + - AcChargeLoopRes + - AcChargeParameterDiscoveryReq + - AcChargeParameterDiscoveryRes + - DcCableCheckReq + - DcCableCheckRes + - DcChargeLoopReq + - DcChargeLoopRes + - DcChargeParameterDiscoveryReq + - DcChargeParameterDiscoveryRes + - DcPreChargeReq + - DcPreChargeRes + - DcWeldingDetectionReq + - DcWeldingDetectionRes + - UnknownMessage + SaeJ2847BidiMode: + description: Bidi mode for sae j2847_2 + type: string + enum: + - None + - V2G + - V2H + CertificateActionEnum: + description: Specifies the type of a certificate request + type: string + enum: + - Install + - Update + EVSEID: + description: >- + An ID that uniquely identifies the EVSE and the power outlet the + vehicle is connected to + type: object + additionalProperties: false + required: + - evse_id + properties: + evse_id: + description: EVSE ID + type: string + evse_id_din: + description: EVSE ID (DIN70121) according to DIN SPEC 91286 + type: string + DcEvsePresentVoltageCurrent: + description: Set the present voltage and current for the EVSE + type: object + additionalProperties: false + required: + - evse_present_voltage + properties: + evse_present_voltage: + description: Output voltage of the EVSE as defined in IEC CDV 61851-23 in V + type: number + minimum: 0 + maximum: 1500 + evse_present_current: + description: Present output current of the EVSE in A + type: number + minimum: 0 + maximum: 10000 + DcEvseMaximumLimits: + description: Maximum Values (current, power and voltage) the EVSE can deliver + type: object + additionalProperties: false + required: + - evse_maximum_current_limit + - evse_maximum_power_limit + - evse_maximum_voltage_limit + properties: + evse_maximum_current_limit: + description: Maximum current the EVSE can deliver in A + type: number + minimum: -10000 + maximum: 10000 + evse_maximum_power_limit: + description: Maximum power the EVSE can deliver in W + type: number + minimum: -1000000 + maximum: 1000000 + evse_maximum_voltage_limit: + description: Maximum voltage the EVSE can deliver in V + type: number + minimum: 0 + maximum: 1500 + evse_maximum_discharge_current_limit: + description: Maximum discharge current the EVSE can deliver in A + type: number + minimum: 0 + maximum: 10000 + evse_maximum_discharge_power_limit: + description: Maximum discharge power the EVSE can deliver in W + type: number + minimum: 0 + maximum: 1000000 + DcEvseMinimumLimits: + description: Minimum Values the EVSE can deliver + type: object + additionalProperties: false + required: + - evse_minimum_current_limit + - evse_minimum_voltage_limit + - evse_minimum_power_limit + properties: + evse_minimum_current_limit: + description: Minimum current the EVSE can deliver with the expected accuracy in A + type: number + minimum: 0 + maximum: 10000 + evse_minimum_voltage_limit: + description: Minimum voltage the EVSE can deliver with the expected accuracy in V + type: number + minimum: 0 + maximum: 1500 + evse_minimum_power_limit: + description: Minimum power the EVSE can deliver with the expected accuracy in W + type: number + minimum: 0 + maximum: 1000000 + evse_minimum_discharge_current_limit: + description: Minimum discharge current the EVSE can deliver in A + type: number + minimum: 0 + maximum: 10000 + evse_minimum_discharge_power_limit: + description: Minimum discharge power the EVSE can deliver in W + type: number + minimum: 0 + maximum: 1000000 + SetupPhysicalValues: + description: >- + Initial physical values for setup a AC or DC charging session + type: object + additionalProperties: false + properties: + ac_nominal_voltage: + description: >- + Set line voltage supported by the EVSE. This is the voltage measured + between one phase and neutral in V. + type: number + minimum: 0 + maximum: 1000 + dc_current_regulation_tolerance: + description: >- + Set the absolute magnitude of the regulation tolerance of the EVSE in A. + type: number + minimum: 0 + maximum: 400 + dc_peak_current_ripple: + description: >- + Set the peak-to-peak magnitude of the current ripple of the EVSE in A. + type: number + minimum: 0 + maximum: 400 + dc_energy_to_be_delivered: + description: Set the amount of energy to be delivered by the EVSE in Wh (optional) + type: number + minimum: 0 + maximum: 200000 + DcEvStatus: + description: Current status of the EV + type: object + additionalProperties: false + required: + - dc_ev_ready + - dc_ev_error_code + - dc_ev_ress_soc + properties: + dc_ev_ready: + description: If set to TRUE, the EV is ready to charge + type: boolean + dc_ev_error_code: + description: Indicates the EV internal status + type: string + $ref: /iso15118#/DcEvErrorCode + dc_ev_ress_soc: + description: State of charge of the EVs battery (RESS) + type: number + minimum: 0 + maximum: 100 + dc_ev_cabin_conditioning: + description: >- + 'DIN70121 only: The EV is using energy from the DC supply to heat + or cool the passenger compartment.' + type: boolean + dc_ev_ress_conditioning: + description: >- + 'DIN70121 only: The vehicle is using energy from the DC charger + to condition the RESS to a target temperature.' + type: boolean + DcEvTargetValues: + description: Target voltage and current requested by the EV + type: object + additionalProperties: false + required: + - dc_ev_target_voltage + - dc_ev_target_current + properties: + dc_ev_target_voltage: + description: Target Voltage requested by EV in V + type: number + minimum: -2 + maximum: 1500 + dc_ev_target_current: + description: Current demanded by EV in A + type: number + minimum: -2 + maximum: 10000 + DcEvMaximumLimits: + description: + Maximum Values (current, power and voltage) supported and allowed + by the EV + type: object + additionalProperties: false + properties: + dc_ev_maximum_current_limit: + description: Maximum current supported and allowed by the EV in A + type: number + minimum: -2 + maximum: 10000 + dc_ev_maximum_power_limit: + description: Maximum power supported and allowed by the EV in W (optional) + type: number + minimum: -2 + maximum: 350000 + dc_ev_maximum_voltage_limit: + description: Maximum voltage supported and allowed by the EV in V + type: number + minimum: -2 + maximum: 1500 + DcEvRemainingTime: + description: Estimated or calculated time until bulk and full charge is complete + type: object + additionalProperties: false + properties: + ev_remaining_time_to_full_soc: + description: + "[RFC3339 UTC] Estimated or calculated time until full charge + (100% SOC) is complete" + type: string + format: date-time + ev_remaining_time_to_full_bulk_soc: + description: + "[RFC3339 UTC] Estimated or calculated time until bulk charge + (approx. 80% SOC) is complete" + type: string + format: date-time + AppProtocol: + description: >- + This message element is used by the EVCC for transmitting the list + of supported protocols + type: object + additionalProperties: false + required: + - protocol_namespace + - version_number_major + - version_number_minor + - schema_id + - priority + properties: + protocol_namespace: + description: >- + This message element is used by the EVCC to uniquely identify + the Namespace URI of a specific protocol supported by the EVCC + type: string + minLength: 1 + maxLength: 100 + version_number_major: + description: >- + This message element is used by the EVCC to indicate the major + version number of the protocol + type: integer + minimum: 0 + version_number_minor: + description: >- + This message element is used by the EVCC to indicate the minor + version number of the protocol + type: integer + minimum: 0 + schema_id: + description: >- + This message element is used by the EVCC to indicate the SchemaID + assigned by the EVCC to the protocol + type: integer + minimum: 0 + maximum: 255 + priority: + description: >- + This message element is used by the EVCC for indicating the protocol + priority of a specific protocol allowing the SECC to select a protocol based + on priorities + type: integer + minimum: 1 + maximum: 20 + AppProtocols: + description: >- + This message element is used by the EVCC for transmitting the list + of supported protocols + type: object + additionalProperties: false + required: + - Protocols + properties: + Protocols: + type: array + items: + type: object + $ref: /iso15118#/AppProtocol + additionalProperties: false + minItems: 1 + maxItems: 20 + V2gMessages: + description: This element contains all V2G elements + type: object + additionalProperties: false + required: + - id + properties: + id: + description: This element contains the id of the v2g message body + type: string + $ref: /iso15118#/V2gMessageId + xml: + description: Contains the decoded EXI stream as V2G message XML file + type: string + minLength: 0 + v2g_json: + description: Contains the decoded EXI stream as V2G message JSON file + type: string + minLength: 0 + exi: + description: Contains the EXI stream as hex string + type: string + minLength: 0 + exi_base64: + description: Contains the EXI stream as base64 string + type: string + minLength: 0 + ResponseExiStreamStatus: + description: The response raw exi stream and the status from the CSMS system + type: object + additionalProperties: false + required: + - status + - certificate_action + properties: + status: + description: >- + Indicates whether the message was processed properly + Accepted - The message was processed properly, exi_response included + Failed - Processing of the message was not successful, no exi_response included + type: string + enum: + - Accepted + - Failed + exi_response: + description: >- + Raw CertificateInstallationRes or CertificateUpdateRes message + as exi stream (Base64 encoded) + type: string + maxLength: 5600 + certificate_action: + description: Type of the certificate request + type: string + $ref: /iso15118#/CertificateActionEnum + RequestExiStreamSchema: + description: The request raw exi stream and the schema version for the CSMS system + type: object + additionalProperties: false + required: + - exi_request + - iso15118_schema_version + - certificate_action + properties: + exi_request: + description: >- + Raw CertificateInstallationReq or CertificateUpdateReq message as + exi stream (Base64 encoded) + type: string + maxLength: 5600 + iso15118_schema_version: + description: Schema Version used for CertificateReq message between EV and Charger + type: string + maxLength: 50 + certificate_action: + description: Type of the certificate request + type: string + $ref: /iso15118#/CertificateActionEnum + CertificateHashDataInfo: + description: Contains the certificate information + type: object + additionalProperties: false + required: + - hashAlgorithm + - issuerNameHash + - issuerKeyHash + - serialNumber + - responderURL + properties: + hashAlgorithm: + description: Used algorithms for the hashes provided + type: string + enum: + - SHA256 + - SHA384 + - SHA512 + issuerNameHash: + description: Hashed value of the Issuer Distinguished Name + type: string + maxLength: 128 + issuerKeyHash: + description: Hashed value of the issuers public key + type: string + maxLength: 128 + serialNumber: + description: The serial number of the certificate + type: string + maxLength: 40 + responderURL: + description: This contains the responder URL + type: string + maxLength: 512 + SupportedEnergyMode: + description: Supported energy mode and if the mode supports bidirectional + type: object + additionalProperties: false + required: + - energy_transfer_mode + - bidirectional + properties: + energy_transfer_mode: + description: The energy mode supported by the SECC + type: string + $ref: /iso15118#/EnergyTransferMode + bidirectional: + description: Set true if the powersupply (AC or DC) supports bidi mode + type: boolean + DisplayParameters: + description: Parameters that may be displayed on the EVSE + type: object + additionalProperties: false + properties: + present_soc: + description: Current SoC of the EV battery + type: number + minimum: 0 + maximum: 100 + minimum_soc: + description: Minimum SoC EV needs after charging + type: number + minimum: 0 + maximum: 100 + target_soc: + description: Target SoC EV needs after charging + type: number + minimum: 0 + maximum: 100 + maximum_soc: + description: The SoC at which the EV will prohibit + type: number + minimum: 0 + maximum: 100 + remaining_time_to_minimum_soc: + description: Remaining time it takes to reach minimum SoC + type: number + minimum: 0 + remaining_time_to_target_soc: + description: Remaining time it takes to reach target SoC + type: number + minimum: 0 + remaining_time_to_maximum_soc: + description: Remaining time it takes to reach maximum SoC + type: number + minimum: 0 + charging_complete: + description: Indication if the charging is complete + type: boolean + battery_energy_capacity: + description: Energy capacity in Wh of the EV battery + type: number + minimum: 0 + inlet_hot: + description: Inlet temperature is too high + type: boolean + DcChargeDynamicModeValues: + description: Parameters for dynamic control mode + type: object + additionalProperties: false + required: + - target_energy_request + - max_energy_request + - min_energy_request + - max_charge_power + - min_charge_power + - max_charge_current + - max_voltage + - min_voltage + properties: + departure_time: + description: The time when the EV wants to finish charging + type: number + minimum: 0 + target_energy_request: + description: Energy request to fulfil the target SoC + type: number + minimum: 0 + max_energy_request: + description: Maximum acceptable energy level of the EV + type: number + minimum: 0 + min_energy_request: + description: Energy request to fulfil the minimum SoC + type: number + minimum: 0 + max_charge_power: + description: Maximum charge power allowed by the EV + type: number + minimum: 0 + min_charge_power: + description: Minimum charge power allowed by the EV + type: number + minimum: 0 + max_charge_current: + description: Maximum charge current allowed by the EV + type: number + minimum: 0 + max_voltage: + description: Maximum voltage allowed by the EV + type: number + minimum: 0 + min_voltage: + description: Minimum voltage allowed by the EV + type: number + minimum: 0 + max_discharge_power: + description: Maximum discharge current allowed by the EV + type: number + minimum: 0 + min_discharge_power: + description: Minimum discharge current allowed by the EV + type: number + minimum: 0 + max_discharge_current: + description: Maximum discharge current allowed by the EV + type: number + minimum: 0 + max_v2x_energy_request: + description: >- + Energy which may be charged until the PresentSOC has left the range + dedicated for cycling activity. + type: number + minimum: 0 + min_v2x_energy_request: + description: >- + Energy which needs to be charged until the PresentSOC has left the + range dedicated for cycling activity. + type: number + minimum: 0 + DERControl: + description: >- + Name of control settings to clear. Not used when _controlId_ is provided. + type: string + enum: + - EnterService + - FreqDroop + - FreqWatt + - FixedPFAbsorb + - FixedPFInject + - FixedVar + - Gradients + - HFMustTrip + - HFMayTrip + - HVMustTrip + - HVMomCess + - HVMayTrip + - LimitMaxDischarge + - LFMustTrip + - LVMustTrip + - LVMomCess + - LVMayTrip + - PowerMonitoringMustTrip + - VoltVar + - VoltWatt + - WattPF + - WattVar + ControlMode: + description: >- + (2.1) Indicates whether EV wants to operate in Dynamic or Scheduled mode. When + absent, Scheduled mode is assumed for backwards compatibility. ISO 15118-20: + ServiceSelectionReq(SelectedEnergyTransferService) + type: string + enum: + - ScheduledControl + - DynamicControl + IslandingDetection: + description: >- + None + type: string + enum: + - NoAntiIslandingSupport + - RoCoF + - UVP_OVP + - UFP_OFP + - VoltageVectorShift + - ZeroCrossingDetection + - OtherPassive + - ImpedanceMeasurement + - ImpedanceAtFrequency + - SlipModeFrequencyShift + - SandiaFrequencyShift + - SandiaVoltageShift + - FrequencyJump + - RCLQFactor + - OtherActive + MobilityNeedsMode: + description: >- + (2.1) Value of EVCC indicates that EV determines min/target SOC and departure + time. A value of EVCC_SECC indicates that charging station or CSMS may also + update min/target SOC and departure time. ISO 15118-20: + ServiceSelectionReq(SelectedEnergyTransferService) + type: string + enum: + - EVCC + - EVCC_SECC + V2XChargingParameters: + description: >- + Charging parameters for ISO 15118-20, also supporting V2X charging/discharging. + All values are greater or equal to zero, with the exception of + EVMinEnergyRequest, EVMaxEnergyRequest, EVTargetEnergyRequest, + EVMinV2XEnergyRequest and EVMaxV2XEnergyRequest. + type: object + required: + [] + properties: + min_charge_power: + description: >- + Minimum charge power in W, defined by max(EV, EVSE). This field represents the + sum of all phases, unless values are provided for L2 and L3, in which case this + field represents phase L1. Relates to: ISO 15118-20: + BPT_AC/DC_CPDReqEnergyTransferModeType: EVMinimumChargePower + type: number + min_charge_power_l2: + description: >- + Minimum charge power on phase L2 in W, defined by max(EV, EVSE). Relates to: ISO + 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: EVMinimumChargePower_L2 + type: number + min_charge_power_l3: + description: >- + Minimum charge power on phase L3 in W, defined by max(EV, EVSE). Relates to: ISO + 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: EVMinimumChargePower_L3 + type: number + max_charge_power: + description: >- + Maximum charge (absorbed) power in W, defined by min(EV, EVSE) at unity power + factor. This field represents the sum of all phases, unless values are provided + for L2 and L3, in which case this field represents phase L1. It corresponds to + the ChaWMax attribute in the IEC 61850. It is usually equivalent to the rated + apparent power of the EV when discharging (ChaVAMax) in IEC 61850. Relates to: + ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: EVMaximumChargePower + type: number + max_charge_power_l2: + description: >- + Maximum charge power on phase L2 in W, defined by min(EV, EVSE) Relates to: ISO + 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: EVMaximumChargePower_L2 + type: number + max_charge_power_l3: + description: >- + Maximum charge power on phase L3 in W, defined by min(EV, EVSE) Relates to: ISO + 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: EVMaximumChargePower_L3 + type: number + min_discharge_power: + description: >- + Minimum discharge (injected) power in W, defined by max(EV, EVSE) at unity power + factor. Value >= 0. This field represents the sum of all phases, unless values + are provided for L2 and L3, in which case this field represents phase L1. It + corresponds to the WMax attribute in the IEC 61850. It is usually equivalent to + the rated apparent power of the EV when discharging (VAMax attribute in the IEC + 61850). Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMinimumDischargePower + type: number + min_discharge_power_l2: + description: >- + Minimum discharge power on phase L2 in W, defined by max(EV, EVSE). Value >= 0. + Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMinimumDischargePower_L2 + type: number + min_discharge_power_l3: + description: >- + Minimum discharge power on phase L3 in W, defined by max(EV, EVSE). Value >= 0. + Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMinimumDischargePower_L3 + type: number + max_discharge_power: + description: >- + Maximum discharge (injected) power in W, defined by min(EV, EVSE) at unity power + factor. Value >= 0. This field represents the sum of all phases, unless values + are provided for L2 and L3, in which case this field represents phase L1. + Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMaximumDischargePower + type: number + max_discharge_power_l2: + description: >- + Maximum discharge power on phase L2 in W, defined by min(EV, EVSE). Value >= 0. + Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMaximumDischargePowe_L2 + type: number + max_discharge_power_l3: + description: >- + Maximum discharge power on phase L3 in W, defined by min(EV, EVSE). Value >= 0. + Relates to: ISO 15118-20: BPT_AC/DC_CPDReqEnergyTransferModeType: + EVMaximumDischargePower_L3 + type: number + min_charge_current: + description: >- + Minimum charge current in A, defined by max(EV, EVSE) Relates to: ISO 15118-20: + BPT_DC_CPDReqEnergyTransferModeType: EVMinimumChargeCurrent + type: number + max_charge_current: + description: >- + Maximum charge current in A, defined by min(EV, EVSE) Relates to: ISO 15118-20: + BPT_DC_CPDReqEnergyTransferModeType: EVMaximumChargeCurrent + type: number + min_discharge_current: + description: >- + Minimum discharge current in A, defined by max(EV, EVSE). Value >= 0. Relates + to: ISO 15118-20: BPT_DC_CPDReqEnergyTransferModeType: EVMinimumDischargeCurrent + type: number + max_discharge_current: + description: >- + Maximum discharge current in A, defined by min(EV, EVSE). Value >= 0. Relates + to: ISO 15118-20: BPT_DC_CPDReqEnergyTransferModeType: EVMaximumDischargeCurrent + type: number + min_voltage: + description: >- + Minimum voltage in V, defined by max(EV, EVSE) Relates to: ISO 15118-20: + BPT_DC_CPDReqEnergyTransferModeType: EVMinimumVoltage + type: number + max_voltage: + description: >- + Maximum voltage in V, defined by min(EV, EVSE) Relates to: ISO 15118-20: + BPT_DC_CPDReqEnergyTransferModeType: EVMaximumVoltage + type: number + ev_target_energy_request: + description: >- + Energy to requested state of charge in Wh Relates to: ISO 15118-20: + Dynamic/Scheduled_SEReqControlModeType: EVTargetEnergyRequest + type: number + ev_min_energy_request: + description: >- + Energy to minimum allowed state of charge in Wh Relates to: ISO 15118-20: + Dynamic/Scheduled_SEReqControlModeType: EVMinimumEnergyRequest + type: number + ev_max_energy_request: + description: >- + Energy to maximum state of charge in Wh Relates to: ISO 15118-20: + Dynamic/Scheduled_SEReqControlModeType: EVMaximumEnergyRequest + type: number + ev_min_v2xenergy_request: + description: >- + Energy (in Wh) to minimum state of charge for cycling (V2X) activity. Positive + value means that current state of charge is below V2X range. Relates to: ISO + 15118-20: Dynamic_SEReqControlModeType: EVMinimumV2XEnergyRequest + type: number + ev_max_v2xenergy_request: + description: >- + Energy (in Wh) to maximum state of charge for cycling (V2X) activity. Negative + value indicates that current state of charge is above V2X range. Relates to: ISO + 15118-20: Dynamic_SEReqControlModeType: EVMaximumV2XEnergyRequest + type: number + target_soc: + description: >- + Target state of charge at departure as percentage. Relates to: ISO 15118-20: + BPT_DC_CPDReqEnergyTransferModeType: TargetSOC + type: integer + EVPriceRule: + description: >- + (2.1) An entry in price schedule over time for which EV is willing to discharge. + type: object + required: + - energy_fee + - power_range_start + properties: + energy_fee: + description: >- + Cost per kWh. + type: number + power_range_start: + description: >- + The EnergyFee applies between this value and the value of the PowerRangeStart of + the subsequent EVPriceRule. If the power is below this value, the EnergyFee of + the previous EVPriceRule applies. Negative values are used for discharging. + type: number + EVPowerScheduleEntry: + description: >- + (2.1) An entry in schedule of the energy amount over time that EV is willing to + discharge. A negative value indicates the willingness to discharge under + specific conditions, a positive value indicates that the EV currently is not + able to offer energy to discharge. + type: object + required: + - duration + - power + properties: + duration: + description: >- + The duration of this entry. + type: integer + power: + description: >- + Defines maximum amount of power for the duration of this EVPowerScheduleEntry to + be discharged from the EV battery through EVSE power outlet. Negative values are + used for discharging. + type: number + EVPowerSchedule: + description: >- + (2.1) Schedule of EV energy offer. + type: object + required: + - ev_power_schedule_entries + - time_anchor + properties: + ev_power_schedule_entries: + description: >- + (2.1) An entry in schedule of the energy amount over time that EV is willing to + discharge. A negative value indicates the willingness to discharge under + specific conditions, a positive value indicates that the EV currently is not + able to offer energy to discharge. + type: array + items: + type: object + $ref: /iso15118#/EVPowerScheduleEntry + minItems: 1 + maxItems: 1024 + time_anchor: + description: >- + The time that defines the starting point for the EVEnergyOffer. + type: string + EVAbsolutePriceScheduleEntry: + description: >- + (2.1) An entry in price schedule over time for which EV is willing to discharge. + type: object + required: + - duration + - ev_price_rule + properties: + duration: + description: >- + The amount of seconds of this entry. + type: integer + ev_price_rule: + description: >- + (2.1) An entry in price schedule over time for which EV is willing to discharge. + type: array + items: + type: object + $ref: /iso15118#/EVPriceRule + minItems: 1 + maxItems: 8 + EVAbsolutePriceSchedule: + description: >- + (2.1) Price schedule of EV energy offer. + type: object + required: + - time_anchor + - currency + - ev_absolute_price_schedule_entries + - price_algorithm + properties: + time_anchor: + description: >- + Starting point in time of the EVEnergyOffer. + type: string + currency: + description: >- + Currency code according to ISO 4217. + type: string + ev_absolute_price_schedule_entries: + description: >- + (2.1) An entry in price schedule over time for which EV is willing to discharge. + type: array + items: + type: object + $ref: /iso15118#/EVAbsolutePriceScheduleEntry + minItems: 1 + maxItems: 1024 + price_algorithm: + description: >- + ISO 15118-20 URN of price algorithm: Power, PeakPower, StackedEnergy. + type: string + EVEnergyOffer: + description: >- + (2.1) A schedule of the energy amount over time that EV is willing to discharge. + A negative value indicates the willingness to discharge under specific + conditions, a positive value indicates that the EV currently is not able to + offer energy to discharge. + type: object + required: + - ev_power_schedule + properties: + ev_absolute_price_schedule: + description: >- + (2.1) Price schedule of EV energy offer. + type: object + $ref: /iso15118#/EVAbsolutePriceSchedule + ev_power_schedule: + description: >- + (2.1) Schedule of EV energy offer. + type: object + $ref: /iso15118#/EVPowerSchedule + DERChargingParameters: + description: >- + (2.1) DERChargingParametersType is used in ChargingNeedsType during an ISO + 15118-20 session for AC_BPT_DER to report the inverter settings related to DER + control that were agreed between EVSE and EV. Fields starting with "ev" contain + values from the EV. Other fields contain a value that is supported by both EV + and EVSE. DERChargingParametersType type is only relevant in case of an ISO + 15118-20 AC_BPT_DER/AC_DER charging session. + type: object + required: + [] + properties: + ev_supported_dercontrol: + description: >- + DER control functions supported by EV. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType:DERControlFunctions (bitmap) + type: array + items: + type: string + $ref: /iso15118#/DERControl + minItems: 1 + ev_over_excited_max_discharge_power: + description: >- + Rated maximum injected active power by EV, at specified over-excited power + factor (overExcitedPowerFactor). It can also be defined as the rated maximum + discharge power at the rated minimum injected reactive power value. This means + that if the EV is providing reactive power support, and it is requested to + discharge at max power (e.g. to satisfy an EMS request), the EV may override the + request and discharge up to overExcitedMaximumDischargePower to meet the minimum + reactive power requirements. Corresponds to the WOvPF attribute in IEC 61850. + ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVOverExcitedMaximumDischargePower + type: number + ev_over_excited_power_factor: + description: >- + EV power factor when injecting (over excited) the minimum reactive power. + Corresponds to the OvPF attribute in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVOverExcitedPowerFactor + type: number + ev_under_excited_max_discharge_power: + description: >- + Rated maximum injected active power by EV supported at specified under-excited + power factor (EVUnderExcitedPowerFactor). It can also be defined as the rated + maximum dischargePower at the rated minimum absorbed reactive power value. This + means that if the EV is providing reactive power support, and it is requested to + discharge at max power (e.g. to satisfy an EMS request), the EV may override the + request and discharge up to underExcitedMaximumDischargePower to meet the + minimum reactive power requirements. This corresponds to the WUnPF attribute in + the IEC 61850. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVUnderExcitedMaximumDischargePower + type: number + ev_under_excited_power_factor: + description: >- + EV power factor when injecting (under excited) the minimum reactive power. + Corresponds to the OvPF attribute in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVUnderExcitedPowerFactor + type: number + max_apparent_power: + description: >- + Rated maximum total apparent power, defined by min(EV, EVSE) in va. Corresponds + to the VAMaxRtg in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumApparentPower + type: number + max_charge_apparent_power: + description: >- + Rated maximum absorbed apparent power, defined by min(EV, EVSE) in va. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. Corresponds to the ChaVAMaxRtg + in IEC 61850. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMaximumChargeApparentPower + type: number + max_charge_apparent_power_l2: + description: >- + Rated maximum absorbed apparent power on phase L2, defined by min(EV, EVSE) in + va. Corresponds to the ChaVAMaxRtg in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumChargeApparentPower_L2 + type: number + max_charge_apparent_power_l3: + description: >- + Rated maximum absorbed apparent power on phase L3, defined by min(EV, EVSE) in + va. Corresponds to the ChaVAMaxRtg in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumChargeApparentPower_L3 + type: number + max_discharge_apparent_power: + description: >- + Rated maximum injected apparent power, defined by min(EV, EVSE) in va. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. Corresponds to the DisVAMaxRtg + in IEC 61850. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMaximumDischargeApparentPower + type: number + max_discharge_apparent_power_l2: + description: >- + Rated maximum injected apparent power on phase L2, defined by min(EV, EVSE) in + va. Corresponds to the DisVAMaxRtg in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumDischargeApparentPower_L2 + type: number + max_discharge_apparent_power_l3: + description: >- + Rated maximum injected apparent power on phase L3, defined by min(EV, EVSE) in + va. Corresponds to the DisVAMaxRtg in IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumDischargeApparentPower_L3 + type: number + max_charge_reactive_power: + description: >- + Rated maximum absorbed reactive power, defined by min(EV, EVSE), in vars. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. Corresponds to the AvarMax + attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumChargeReactivePower + type: number + max_charge_reactive_power_l2: + description: >- + Rated maximum absorbed reactive power, defined by min(EV, EVSE), in vars on + phase L2. Corresponds to the AvarMax attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumChargeReactivePower_L2 + type: number + max_charge_reactive_power_l3: + description: >- + Rated maximum absorbed reactive power, defined by min(EV, EVSE), in vars on + phase L3. Corresponds to the AvarMax attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumChargeReactivePower_L3 + type: number + min_charge_reactive_power: + description: >- + Rated minimum absorbed reactive power, defined by max(EV, EVSE), in vars. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMinimumChargeReactivePower + type: number + min_charge_reactive_power_l2: + description: >- + Rated minimum absorbed reactive power, defined by max(EV, EVSE), in vars on + phase L2. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMinimumChargeReactivePower_L2 + type: number + min_charge_reactive_power_l3: + description: >- + Rated minimum absorbed reactive power, defined by max(EV, EVSE), in vars on + phase L3. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMinimumChargeReactivePower_L3 + type: number + max_discharge_reactive_power: + description: >- + Rated maximum injected reactive power, defined by min(EV, EVSE), in vars. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. Corresponds to the IvarMax + attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumDischargeReactivePower + type: number + max_discharge_reactive_power_l2: + description: >- + Rated maximum injected reactive power, defined by min(EV, EVSE), in vars on + phase L2. Corresponds to the IvarMax attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumDischargeReactivePower_L2 + type: number + max_discharge_reactive_power_l3: + description: >- + Rated maximum injected reactive power, defined by min(EV, EVSE), in vars on + phase L3. Corresponds to the IvarMax attribute in the IEC 61850. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumDischargeReactivePower_L3 + type: number + min_discharge_reactive_power: + description: >- + Rated minimum injected reactive power, defined by max(EV, EVSE), in vars. This + field represents the sum of all phases, unless values are provided for L2 and + L3, in which case this field represents phase L1. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMinimumDischargeReactivePower + type: number + min_discharge_reactive_power_l2: + description: >- + Rated minimum injected reactive power, defined by max(EV, EVSE), in var on phase + L2. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMinimumDischargeReactivePower_L2 + type: number + min_discharge_reactive_power_l3: + description: >- + Rated minimum injected reactive power, defined by max(EV, EVSE), in var on phase + L3. ISO 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: + EVMinimumDischargeReactivePower_L3 + type: number + nominal_voltage: + description: >- + Line voltage supported by EVSE and EV. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVNominalVoltage + type: number + nominal_voltage_offset: + description: >- + The nominal AC voltage (rms) offset between the Charging Station's electrical + connection point and the utility’s point of common coupling. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVNominalVoltageOffset + type: number + max_nominal_voltage: + description: >- + Maximum AC rms voltage, as defined by min(EV, EVSE) to operate with. ISO + 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumNominalVoltage + type: number + min_nominal_voltage: + description: >- + Minimum AC rms voltage, as defined by max(EV, EVSE) to operate with. ISO + 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: EVMinimumNominalVoltage + type: number + ev_inverter_manufacturer: + description: >- + Manufacturer of the EV inverter. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVInverterManufacturer + type: string + ev_inverter_model: + description: >- + Model name of the EV inverter. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVInverterModel + type: string + ev_inverter_serial_number: + description: >- + Serial number of the EV inverter. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVInverterSerialNumber + type: string + ev_inverter_sw_version: + description: >- + Software version of EV inverter. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVInverterSwVersion + type: string + ev_inverter_hw_version: + description: >- + Hardware version of EV inverter. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVInverterHwVersion + type: string + ev_islanding_detection_method: + description: >- + Type of islanding detection method. Only mandatory when islanding detection is + required at the site, as set in the ISO 15118 Service Details configuration. ISO + 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: EVIslandingDetectionMethod + type: array + items: + type: string + $ref: /iso15118#/IslandingDetection + minItems: 1 + ev_islanding_trip_time: + description: >- + Time after which EV will trip if an island has been detected. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVIslandingTripTime + type: number + ev_maximum_level1dcinjection: + description: >- + Maximum injected DC current allowed at level 1 charging. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumLevel1DCInjection + type: number + ev_duration_level1dcinjection: + description: >- + Maximum allowed duration of DC injection at level 1 charging. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVDurationLevel1DCInjection + type: number + ev_maximum_level2dcinjection: + description: >- + Maximum injected DC current allowed at level 2 charging. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVMaximumLevel2DCInjection + type: number + ev_duration_level2dcinjection: + description: >- + Maximum allowed duration of DC injection at level 2 charging. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVDurationLevel2DCInjection + type: number + ev_reactive_susceptance: + description: >- + Measure of the susceptibility of the circuit to reactance, in Siemens (S). ISO + 15118-20: DER_BPT_AC_CPDReqEnergyTransferModeType: EVReactiveSusceptance + type: number + ev_session_total_discharge_energy_available: + description: >- + Total energy value, in Wh, that EV is allowed to provide during the entire V2G + session. The value is independent of the V2X Cycling area. Once this value + reaches the value of 0, the EV may block any attempt to discharge in order to + protect the battery health. ISO 15118-20: + DER_BPT_AC_CPDReqEnergyTransferModeType: EVSessionTotalDischargeEnergyAvailable + type: number + DCChargingParameters: + description: >- + EV DC charging parameters for ISO 15118-2 + type: object + required: + - ev_max_current + - ev_max_voltage + properties: + ev_max_current: + description: >- + Maximum current (in A) supported by the electric vehicle. Includes cable + capacity. Relates to: ISO 15118-2: + DC_EVChargeParameterType:EVMaximumCurrentLimit + type: number + ev_max_voltage: + description: >- + Maximum voltage supported by the electric vehicle. Relates to: ISO 15118-2: + DC_EVChargeParameterType: EVMaximumVoltageLimit + type: number + ev_max_power: + description: >- + Maximum power (in W) supported by the electric vehicle. Required for DC + charging. Relates to: ISO 15118-2: DC_EVChargeParameterType: EVMaximumPowerLimit + type: number + ev_energy_capacity: + description: >- + Capacity of the electric vehicle battery (in Wh). Relates to: ISO 15118-2: + DC_EVChargeParameterType: EVEnergyCapacity + type: number + energy_amount: + description: >- + Amount of energy requested (in Wh). This includes energy required for + preconditioning. Relates to: ISO 15118-2: DC_EVChargeParameterType: + EVEnergyRequest + type: number + state_of_charge: + description: >- + Energy available in the battery (in percent of the battery capacity) Relates to: + ISO 15118-2: DC_EVChargeParameterType: DC_EVStatus: EVRESSSOC + type: integer + full_soc: + description: >- + Percentage of SoC at which the EV considers the battery fully charged. (possible + values: 0 - 100) Relates to: ISO 15118-2: DC_EVChargeParameterType: FullSOC + type: integer + bulk_soc: + description: >- + Percentage of SoC at which the EV considers a fast charging process to end. + (possible values: 0 - 100) Relates to: ISO 15118-2: DC_EVChargeParameterType: + BulkSOC + type: integer + ACChargingParameters: + description: >- + EV AC charging parameters for ISO 15118-2 + type: object + required: + - energy_amount + - ev_min_current + - ev_max_current + - ev_max_voltage + properties: + energy_amount: + description: >- + Amount of energy requested (in Wh). This includes energy required for + preconditioning. Relates to: ISO 15118-2: AC_EVChargeParameterType: EAmount ISO + 15118-20: Dynamic/Scheduled_SEReqControlModeType: EVTargetEnergyRequest + type: number + ev_min_current: + description: >- + Minimum current (amps) supported by the electric vehicle (per phase). Relates + to: ISO 15118-2: AC_EVChargeParameterType: EVMinCurrent + type: number + ev_max_current: + description: >- + Maximum current (amps) supported by the electric vehicle (per phase). Includes + cable capacity. Relates to: ISO 15118-2: AC_EVChargeParameterType: EVMaxCurrent + type: number + ev_max_voltage: + description: >- + Maximum voltage supported by the electric vehicle. Relates to: ISO 15118-2: + AC_EVChargeParameterType: EVMaxVoltage + type: number + ChargingNeeds: + description: >- + None + type: object + required: + - requested_energy_transfer + properties: + ac_charging_parameters: + description: >- + EV AC charging parameters for ISO 15118-2 + type: object + $ref: /iso15118#/ACChargingParameters + der_charging_parameters: + description: >- + (2.1) DERChargingParametersType is used in ChargingNeedsType during an ISO + 15118-20 session for AC_BPT_DER to report the inverter settings related to DER + control that were agreed between EVSE and EV. Fields starting with "ev" contain + values from the EV. Other fields contain a value that is supported by both EV + and EVSE. DERChargingParametersType type is only relevant in case of an ISO + 15118-20 AC_BPT_DER/AC_DER charging session. + type: object + $ref: /iso15118#/DERChargingParameters + ev_energy_offer: + description: >- + (2.1) A schedule of the energy amount over time that EV is willing to discharge. + A negative value indicates the willingness to discharge under specific + conditions, a positive value indicates that the EV currently is not able to + offer energy to discharge. + type: object + $ref: /iso15118#/EVEnergyOffer + requested_energy_transfer: + description: >- + Mode of energy transfer requested by the EV. + type: object + $ref: /iso15118#/EnergyTransferMode + dc_charging_parameters: + description: >- + EV DC charging parameters for ISO 15118-2 + type: object + $ref: /iso15118#/DCChargingParameters + v2x_charging_parameters: + description: >- + Charging parameters for ISO 15118-20, also supporting V2X charging/discharging. + All values are greater or equal to zero, with the exception of + EVMinEnergyRequest, EVMaxEnergyRequest, EVTargetEnergyRequest, + EVMinV2XEnergyRequest and EVMaxV2XEnergyRequest. + type: object + $ref: /iso15118#/V2XChargingParameters + available_energy_transfer: + description: >- + (2.1) Modes of energy transfer that are marked as available by EV. + type: array + items: + type: string + $ref: /iso15118#/EnergyTransferMode + minItems: 1 + control_mode: + description: >- + (2.1) Indicates whether EV wants to operate in Dynamic or Scheduled mode. When + absent, Scheduled mode is assumed for backwards compatibility. ISO 15118-20: + ServiceSelectionReq(SelectedEnergyTransferService) + type: object + $ref: /iso15118#/ControlMode + mobility_needs_mode: + description: >- + (2.1) Value of EVCC indicates that EV determines min/target SOC and departure + time. A value of EVCC_SECC indicates that charging station or CSMS may also + update min/target SOC and departure time. ISO 15118-20: + ServiceSelectionReq(SelectedEnergyTransferService) + type: object + $ref: /iso15118#/MobilityNeedsMode + departure_time: + description: >- + Estimated departure time of the EV. ISO 15118-2: AC/DC_EVChargeParameterType: + DepartureTime ISO 15118-20: Dynamic/Scheduled_SEReqControlModeType: + DepartureTime + type: string +# EV Side + DcEvParameters: + description: Target settings for dc charging + type: object + additionalProperties: false + properties: + max_current_limit: + description: "[A] Maximum current allowed by the EV" + type: number + minimum: 0 + maximum: 1000 + max_power_limit: + description: "[W] Maximum power allowed by the EV" + type: number + minimum: 0 + maximum: 500000 + max_voltage_limit: + description: "[V] Maximum voltage allowed by the EV" + type: number + minimum: 0 + maximum: 1500 + energy_capacity: + description: "[Wh] Energy capacity of the EV" + type: number + minimum: 0 + maximum: 100000 + target_current: + description: "[A] Target current requested by the EV" + type: number + minimum: 0 + maximum: 1000 + target_voltage: + description: "[V] Target voltage requested by the EV" + type: number + minimum: 0 + maximum: 1500 + DcEvBPTParameters: + description: BPT settings for dc charging + type: object + additionalProperties: false + properties: + discharge_max_current_limit: + description: "[A] Maximum discharge current allowed by the EV" + type: number + minimum: 0 + maximum: 1000 + discharge_max_power_limit: + description: "[W] Maximum discharge power allowed by the EV" + type: number + minimum: 0 + maximum: 500000 + discharge_target_current: + description: "[A] Discharge target current requested by the EV" + type: number + minimum: 0 + maximum: 1500 + discharge_minimal_soc: + description: "[%] Discharge minimal soc at which the evse should shutdown" + type: number + minimum: 0 + maximum: 99 diff --git a/types/iso15118_charger.yaml b/types/iso15118_charger.yaml deleted file mode 100644 index d8a2893b4..000000000 --- a/types/iso15118_charger.yaml +++ /dev/null @@ -1,665 +0,0 @@ -description: ISO15118 charger types -types: - PaymentOption: - description: Payment options for the SECC and EVCC - type: string - enum: - - Contract - - ExternalPayment - EnergyTransferMode: - description: Possible energy transfer modes - type: string - enum: - - AC_single_phase_core - - AC_three_phase_core - - DC_core - - DC_extended - - DC_combo_core - - DC_unique - IsolationStatus: - description: The different charger isolation status - type: string - enum: - - Invalid - - Valid - - Warning - - Fault - - No_IMD - DcEvErrorCode: - description: Indicates the DC EV internal status - type: string - enum: - - NO_ERROR - - FAILED_RESSTemperatureInhibit - - FAILED_EVShiftPosition - - FAILED_ChargerConnectorLockFault - - FAILED_EVRESSMalfunction - - FAILED_ChargingCurrentdifferentia - - FAILED_ChargingVoltageOutOfRange - - Reserved_A - - Reserved_B - - Reserved_C - - FAILED_ChargingSystemIncompatibility - - NoData - EvseError: - description: >- - Details on error type - Error_Contactor: The contactor is opened or closed at the wrong moment. - Error_RCD: The RCD has detected an error. - Error_UtilityInterruptEvent: Utility Interrupt Event, Utility or Equipment operator has requested a temporary reduction in load - Error_Malfunction: A non-recoverable charger fault has occurred (Isolation Failure, ...). It is permanently faulted. - Error_EmergencyShutdown: Charging System Incompatibility, Emergency Shutdown or E-Stop button pressed at charging station - type: string - enum: - - Error_Contactor - - Error_RCD - - Error_UtilityInterruptEvent - - Error_Malfunction - - Error_EmergencyShutdown - V2gMessageId: - description: This element contains the id of the v2g message body - type: string - enum: - - SupportedAppProtocolReq - - SupportedAppProtocolRes - - SessionSetupReq - - SessionSetupRes - - ServiceDiscoveryReq - - ServiceDiscoveryRes - - ServiceDetailReq - - ServiceDetailRes - - PaymentServiceSelectionReq - - PaymentServiceSelectionRes - - ServicePaymentSelectionReq - - ServicePaymentSelectionRes - - PaymentDetailsReq - - PaymentDetailsRes - - AuthorizationReq - - AuthorizationRes - - ContractAuthenticationReq - - ContractAuthenticationRes - - ChargeParameterDiscoveryReq - - ChargeParameterDiscoveryRes - - ChargingStatusReq - - ChargingStatusRes - - MeteringReceiptReq - - MeteringReceiptRes - - PowerDeliveryReq - - PowerDeliveryRes - - CableCheckReq - - CableCheckRes - - PreChargeReq - - PreChargeRes - - CurrentDemandReq - - CurrentDemandRes - - WeldingDetectionReq - - WeldingDetectionRes - - SessionStopReq - - SessionStopRes - - CertificateInstallationReq - - CertificateInstallationRes - - CertificateUpdateReq - - CertificateUpdateRes - - AuthorizationSetupReq - - AuthorizationSetupRes - - ScheduleExchangeReq - - ScheduleExchangeRes - - ServiceSelectionReq - - ServiceSelectionRes - - AcChargeLoopReq - - AcChargeLoopRes - - AcChargeParameterDiscoveryReq - - AcChargeParameterDiscoveryRes - - DcCableCheckReq - - DcCableCheckRes - - DcChargeLoopReq - - DcChargeLoopRes - - DcChargeParameterDiscoveryReq - - DcChargeParameterDiscoveryRes - - DcPreChargeReq - - DcPreChargeRes - - DcWeldingDetectionReq - - DcWeldingDetectionRes - - UnknownMessage - SaeJ2847BidiMode: - description: Bidi mode for sae j2847_2 - type: string - enum: - - None - - V2G - - V2H - CertificateActionEnum: - description: Specifies the type of a certificate request - type: string - enum: - - Install - - Update - EVSEID: - description: >- - An ID that uniquely identifies the EVSE and the power outlet the - vehicle is connected to - type: object - additionalProperties: false - required: - - evse_id - properties: - evse_id: - description: EVSE ID - type: string - evse_id_din: - description: EVSE ID (DIN70121) according to DIN SPEC 91286 - type: string - DcEvsePresentVoltageCurrent: - description: Set the present voltage and current for the EVSE - type: object - additionalProperties: false - required: - - evse_present_voltage - properties: - evse_present_voltage: - description: Output voltage of the EVSE as defined in IEC CDV 61851-23 in V - type: number - minimum: 0 - maximum: 1500 - evse_present_current: - description: Present output current of the EVSE in A - type: number - minimum: 0 - maximum: 10000 - DcEvseMaximumLimits: - description: Maximum Values (current, power and voltage) the EVSE can deliver - type: object - additionalProperties: false - required: - - evse_maximum_current_limit - - evse_maximum_power_limit - - evse_maximum_voltage_limit - properties: - evse_maximum_current_limit: - description: Maximum current the EVSE can deliver in A - type: number - minimum: -10000 - maximum: 10000 - evse_maximum_power_limit: - description: Maximum power the EVSE can deliver in W - type: number - minimum: -1000000 - maximum: 1000000 - evse_maximum_voltage_limit: - description: Maximum voltage the EVSE can deliver in V - type: number - minimum: 0 - maximum: 1500 - evse_maximum_discharge_current_limit: - description: Maximum discharge current the EVSE can deliver in A - type: number - minimum: 0 - maximum: 10000 - evse_maximum_discharge_power_limit: - description: Maximum discharge power the EVSE can deliver in W - type: number - minimum: 0 - maximum: 1000000 - DcEvseMinimumLimits: - description: Minimum Values the EVSE can deliver - type: object - additionalProperties: false - required: - - evse_minimum_current_limit - - evse_minimum_voltage_limit - - evse_minimum_power_limit - properties: - evse_minimum_current_limit: - description: Minimum current the EVSE can deliver with the expected accuracy in A - type: number - minimum: 0 - maximum: 10000 - evse_minimum_voltage_limit: - description: Minimum voltage the EVSE can deliver with the expected accuracy in V - type: number - minimum: 0 - maximum: 1500 - evse_minimum_power_limit: - description: Minimum power the EVSE can deliver with the expected accuracy in W - type: number - minimum: 0 - maximum: 1000000 - evse_minimum_discharge_current_limit: - description: Minimum discharge current the EVSE can deliver in A - type: number - minimum: 0 - maximum: 10000 - evse_minimum_discharge_power_limit: - description: Minimum discharge power the EVSE can deliver in W - type: number - minimum: 0 - maximum: 1000000 - SetupPhysicalValues: - description: >- - Initial physical values for setup a AC or DC charging session - type: object - additionalProperties: false - properties: - ac_nominal_voltage: - description: >- - Set line voltage supported by the EVSE. This is the voltage measured - between one phase and neutral in V. - type: number - minimum: 0 - maximum: 1000 - dc_current_regulation_tolerance: - description: >- - Set the absolute magnitude of the regulation tolerance of the EVSE in A. - type: number - minimum: 0 - maximum: 400 - dc_peak_current_ripple: - description: >- - Set the peak-to-peak magnitude of the current ripple of the EVSE in A. - type: number - minimum: 0 - maximum: 400 - dc_energy_to_be_delivered: - description: Set the amount of energy to be deliveredby the EVSE in Wh (optional) - type: number - minimum: 0 - maximum: 200000 - DcEvStatus: - description: Current status of the EV - type: object - additionalProperties: false - required: - - dc_ev_ready - - dc_ev_error_code - - dc_ev_ress_soc - properties: - dc_ev_ready: - description: If set to TRUE, the EV is ready to charge - type: boolean - dc_ev_error_code: - description: Indicates the EV internal status - type: string - $ref: /iso15118_charger#/DcEvErrorCode - dc_ev_ress_soc: - description: State of charge of the EVs battery (RESS) - type: number - minimum: 0 - maximum: 100 - dc_ev_cabin_conditioning: - description: >- - 'DIN70121 only: The EV is using energy from the DC supply toheat - or cool the passenger compartment.' - type: boolean - dc_ev_ress_conditioning: - description: >- - 'DIN70121 only: The vehicle is using energy from the DC charger - to condition the RESS to a target temperature.' - type: boolean - DcEvTargetValues: - description: Target voltage and current requested by the EV - type: object - additionalProperties: false - required: - - dc_ev_target_voltage - - dc_ev_target_current - properties: - dc_ev_target_voltage: - description: Target Voltage requested by EV in V - type: number - minimum: -2 - maximum: 1500 - dc_ev_target_current: - description: Current demanded by EV in A - type: number - minimum: -2 - maximum: 10000 - DcEvMaximumLimits: - description: - Maximum Values (current, power and voltage) supported and allowed - by the EV - type: object - additionalProperties: false - properties: - dc_ev_maximum_current_limit: - description: Maximum current supported and allowed by the EV in A - type: number - minimum: -2 - maximum: 10000 - dc_ev_maximum_power_limit: - description: Maximum power supported and allowed by the EV in W (optional) - type: number - minimum: -2 - maximum: 350000 - dc_ev_maximum_voltage_limit: - description: Maximum voltage supported and allowed by the EV in V - type: number - minimum: -2 - maximum: 1500 - DcEvRemainingTime: - description: Estimated or calculated time until bulk and full charge is complete - type: object - additionalProperties: false - properties: - ev_remaining_time_to_full_soc: - description: - "[RFC3339 UTC] Estimated or calculated time until full charge - (100% SOC) is complete" - type: string - format: date-time - ev_remaining_time_to_full_bulk_soc: - description: - "[RFC3339 UTC] Estimated or calculated time until bulk charge - (approx. 80% SOC) is complete" - type: string - format: date-time - AppProtocol: - description: >- - This message element is used by the EVCC for transmitting the list - of supported protocols - type: object - additionalProperties: false - required: - - protocol_namespace - - version_number_major - - version_number_minor - - schema_id - - priority - properties: - protocol_namespace: - description: >- - This message element is used by the EVCC to uniquely identify - the Namespace URI of a specific protocol supported by the EVCC - type: string - minLength: 1 - maxLength: 100 - version_number_major: - description: >- - This message element is used by the EVCC to indicate the major - version number of the protocol - type: integer - minimum: 0 - version_number_minor: - description: >- - This message element is used by the EVCC to indicate the minor - version number of the protocol - type: integer - minimum: 0 - schema_id: - description: >- - This message element is used by the EVCC to indicate the SchemaID - assigned by the EVCC to the protocol - type: integer - minimum: 0 - maximum: 255 - priority: - description: >- - This message element is used by the EVCC for indicating the protocol - priority of a specific protocol allowing the SECC to select a protocol based - on priorities - type: integer - minimum: 1 - maximum: 20 - AppProtocols: - description: >- - This message element is used by the EVCC for transmitting the list - of supported protocols - type: object - additionalProperties: false - required: - - Protocols - properties: - Protocols: - type: array - items: - type: object - $ref: /iso15118_charger#/AppProtocol - additionalProperties: false - minItems: 1 - maxItems: 20 - V2gMessages: - description: This element contains all V2G elements - type: object - additionalProperties: false - required: - - id - properties: - id: - description: This element contains the id of the v2g message body - type: string - $ref: /iso15118_charger#/V2gMessageId - xml: - description: Contains the decoded EXI stream as V2G message XML file - type: string - minLength: 0 - v2g_json: - description: Contains the decoded EXI stream as V2G message JSON file - type: string - minLength: 0 - exi: - description: Contains the EXI stream as hex string - type: string - minLength: 0 - exi_base64: - description: Contains the EXI stream as base64 string - type: string - minLength: 0 - ResponseExiStreamStatus: - description: The response raw exi stream and the status from the CSMS system - type: object - additionalProperties: false - required: - - status - - certificate_action - properties: - status: - description: >- - Indicates whether the message was processed properly - Accepted - The message was processed properly, exi_response included - Failed - Processing of the message was not successful, no exi_response included - type: string - enum: - - Accepted - - Failed - exi_response: - description: >- - Raw CertificateInstallationRes or CertificateUpdateRes message - as exi stream (Base64 encoded) - type: string - maxLength: 5600 - certificate_action: - description: Type of the certificate request - type: string - $ref: /iso15118_charger#/CertificateActionEnum - RequestExiStreamSchema: - description: The request raw exi stream and the schema version for the CSMS system - type: object - additionalProperties: false - required: - - exi_request - - iso15118_schema_version - - certificate_action - properties: - exi_request: - description: >- - Raw CertificateInstallationReq or CertificateUpdateReq message as - exi stream (Base64 encoded) - type: string - maxLength: 5600 - iso15118_schema_version: - description: Schema Version used for CertificateReq message between EV and Charger - type: string - maxLength: 50 - certificate_action: - description: Type of the certificate request - type: string - $ref: /iso15118_charger#/CertificateActionEnum - CertificateHashDataInfo: - description: Contains the certificate information - type: object - additionalProperties: false - required: - - hashAlgorithm - - issuerNameHash - - issuerKeyHash - - serialNumber - - responderURL - properties: - hashAlgorithm: - description: Used algorithms for the hashes provided - type: string - enum: - - SHA256 - - SHA384 - - SHA512 - issuerNameHash: - description: Hashed value of the Issuer Distinguished Name - type: string - maxLength: 128 - issuerKeyHash: - description: Hashed value of the issuers public key - type: string - maxLength: 128 - serialNumber: - description: The serial number of the certificate - type: string - maxLength: 40 - responderURL: - description: This contains the responder URL - type: string - maxLength: 512 - SupportedEnergyMode: - description: Supported energy mode and if the mode supports bidirectional - type: object - additionalProperties: false - required: - - energy_transfer_mode - - bidirectional - properties: - energy_transfer_mode: - description: The energy mode supported by the SECC - type: string - $ref: /iso15118_charger#/EnergyTransferMode - bidirectional: - description: Set true if the powersupply (AC or DC) supports bidi mode - type: boolean - DisplayParameters: - description: Parameters that may be displayed on the EVSE - type: object - additionalProperties: false - properties: - present_soc: - description: Current SoC of the EV battery - type: number - minimum: 0 - maximum: 100 - minimum_soc: - description: Minimum SoC EV needs after charging - type: number - minimum: 0 - maximum: 100 - target_soc: - description: Target SoC EV needs after charging - type: number - minimum: 0 - maximum: 100 - maximum_soc: - description: The SoC at which the EV will prohibit - type: number - minimum: 0 - maximum: 100 - remaining_time_to_minimum_soc: - description: Remaining time it takes to reach minimum SoC - type: number - minimum: 0 - remaining_time_to_target_soc: - description: Remaining time it takes to reach target SoC - type: number - minimum: 0 - remaining_time_to_maximum_soc: - description: Remaining time it takes to reach maximum SoC - type: number - minimum: 0 - charging_complete: - description: Indication if the charging is complete - type: boolean - battery_energy_capacity: - description: Energy capacity in Wh of the EV battery - type: number - minimum: 0 - inlet_hot: - description: Inlet temperature is too high - type: boolean - DcChargeDynamicModeValues: - description: Parameters for dynamic control mode - type: object - additionalProperties: false - required: - - target_energy_request - - max_energy_request - - min_energy_request - - max_charge_power - - min_charge_power - - max_charge_current - - max_voltage - - min_voltage - properties: - departure_time: - description: The time when the EV wants to finish charging - type: number - minimum: 0 - target_energy_request: - description: Energy request to fulfil the target SoC - type: number - minimum: 0 - max_energy_request: - description: Maximum acceptable energy level of the EV - type: number - minimum: 0 - min_energy_request: - description: Energy request to fulfil the minimum SoC - type: number - minimum: 0 - max_charge_power: - description: Maximum charge power allowed by the EV - type: number - minimum: 0 - min_charge_power: - description: Minimum charge power allowed by the EV - type: number - minimum: 0 - max_charge_current: - description: Maximum charge current allowed by the EV - type: number - minimum: 0 - max_voltage: - description: Maximum voltage allowed by the EV - type: number - minimum: 0 - min_voltage: - description: Minimum voltage allowd by the EV - type: number - minimum: 0 - max_discharge_power: - description: Maximum discharge current allowed by the EV - type: number - minimum: 0 - min_discharge_power: - description: Minimum discharge current allowed by the EV - type: number - minimum: 0 - max_discharge_current: - description: Maximum discharge current allowed by the EV - type: number - minimum: 0 - max_v2x_energy_request: - description: >- - Energy which may be charged until the PresentSOC has left the range - dedicated for cycling activity. - type: number - minimum: 0 - min_v2x_energy_request: - description: >- - Energy which needs to be charged until the PresentSOC has left the - range dedicated for cycling activity. - type: number - minimum: 0 diff --git a/types/iso15118_ev.yaml b/types/iso15118_ev.yaml deleted file mode 100644 index 0da9b8059..000000000 --- a/types/iso15118_ev.yaml +++ /dev/null @@ -1,72 +0,0 @@ -description: ISO15118 ev types -types: - EnergyTransferMode: - description: Possible energy transfer modes - type: string - enum: - - AC_single_phase_core - - AC_three_phase_core - - DC_core - - DC_extended - - DC_combo_core - - DC_unique - DC_EVParameters: - description: Target settings for dc charging - type: object - additionalProperties: false - properties: - MaxCurrentLimit: - description: "[A] Maximum current allowed by the EV" - type: number - minimum: 0 - maximum: 1000 - MaxPowerLimit: - description: "[W] Maximum power allowed by the EV" - type: number - minimum: 0 - maximum: 500000 - MaxVoltageLimit: - description: "[V] Maximum voltage allowed by the EV" - type: number - minimum: 0 - maximum: 1500 - EnergyCapacity: - description: "[Wh] Energy capacity of the EV" - type: number - minimum: 0 - maximum: 100000 - TargetCurrent: - description: "[A] Target current requested by the EV" - type: number - minimum: 0 - maximum: 1000 - TargetVoltage: - description: "[V] Target voltage requested by the EV" - type: number - minimum: 0 - maximum: 1500 - DC_EV_BPT_Parameters: - description: BPT settings for dc charging - type: object - additionalProperties: false - properties: - DischargeMaxCurrentLimit: - description: "[A] Maximum discharge current allowed by the EV" - type: number - minimum: 0 - maximum: 1000 - DischargeMaxPowerLimit: - description: "[W] Maximum discharge power allowed by the EV" - type: number - minimum: 0 - maximum: 500000 - DischargeTargetCurrent: - description: "[A] Discharge target current requested by the EV" - type: number - minimum: 0 - maximum: 1500 - DischargeMinimalSoC: - description: "[%] Discharge minimal soc at which the evse should shutdown" - type: number - minimum: 0 - maximum: 99