Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new iso15118_extension interface #1022

Merged
merged 14 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/config-sil-dc-isomux-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ active_modules:
iso20:
- module_id: iso15118_20
implementation_id: charger
ext2:
- module_id: iso15118_2
implementation_id: extensions
ext20:
- module_id: iso15118_20
implementation_id: extensions
iso15118_car:
module: PyEvJosev
config_module:
Expand Down
6 changes: 6 additions & 0 deletions config/config-sil-dc-isomux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ active_modules:
iso20:
- module_id: iso15118_20
implementation_id: charger
ext2:
- module_id: iso15118_2
implementation_id: extensions
ext20:
- module_id: iso15118_20
implementation_id: extensions
iso15118_car:
module: PyEvJosev
config_module:
Expand Down
3 changes: 3 additions & 0 deletions config/config-sil-ocpp-pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ active_modules:
implementation_id: external_limits
- module_id: evse_manager_2_ocpp_sink
implementation_id: external_limits
extensions_15118:
- module_id: iso15118_charger
implementation_id: extensions
evse_security:
module: EvseSecurity
config_module:
Expand Down
3 changes: 3 additions & 0 deletions config/config-sil-ocpp201-pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ active_modules:
reservation:
- module_id: auth
implementation_id: reservation
extensions_15118:
- module_id: iso15118_charger
implementation_id: extensions
evse_security:
module: EvseSecurity
config_module:
Expand Down
17 changes: 0 additions & 17 deletions interfaces/ISO15118_charger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ cmds:
connection to an SA for this purpose
type: boolean
# Response messages to vars:
certificate_response:
description: >-
This message is an async response to a previously published certificate_request.
The new/updated Contract Certificate (including the certificate chain) and the
corresponding encrypted private key are sent via the SECC to the EVCC.
arguments:
exi_stream_status:
description: The response raw EXI stream and the status from the CSMS
type: object
$ref: /iso15118_charger#/ResponseExiStreamStatus
authorization_response:
description: >-
This message is an async response to a previously published require_auth_eim
Expand Down Expand Up @@ -314,13 +304,6 @@ vars:
description: Estimated or calculated time until bulk and full charge is complete
type: object
$ref: /iso15118_charger#/DcEvRemainingTime
certificate_request:
description: >-
The vehicle requests the SECC to deliver the certificate that belong
to the currently valid contract of the vehicle.
Response will be reported async via set_Get_Certificate_Response
type: object
$ref: /iso15118_charger#/RequestExiStreamSchema
dlink_terminate:
description: Terminate the data link and become UNMATCHED.
type: "null"
Expand Down
17 changes: 0 additions & 17 deletions interfaces/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@ cmds:
result:
description: Returns true if unlocking sequence was successfully executed
type: boolean
set_get_certificate_response:
description: >-
CertificateInstallationRes/CertificateUpdateRes - Set the new/updated Contract Certificate (including the certificate chain)
and the corresponding encrypted private key. Should be forwared to EVCC.
This is an async response to a previously published iso15118_certificate_request
arguments:
certificate_response:
description: The response raw exi stream and the status from the CSMS system
type: object
$ref: /iso15118_charger#/ResponseExiStreamStatus
external_ready_to_start_charging:
description: >-
There are situations where another module needs to do some initialization after evse manager is in principle ready to start charging.
Expand Down Expand Up @@ -154,13 +144,6 @@ vars:
description: "Hardware capability/limits"
type: object
$ref: /evse_board_support#/HardwareCapabilities
iso15118_certificate_request:
description: >-
The vehicle requests the SECC to deliver the certificate that belong
to the currently valid contract of the vehicle.
Response will be reported async via set_get_certificate_response
type: object
$ref: /iso15118_charger#/RequestExiStreamSchema
enforced_limits:
description: Enforced limits for this node (coming from the EnergyManager)
type: object
Expand Down
20 changes: 20 additions & 0 deletions interfaces/iso15118_extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: This interface is used to share data between ISO15118 and OCPP modules to support the requirements of the OCPP protocol
cmds:
set_get_certificate_response:
description: >-
CertificateInstallationRes/CertificateUpdateRes - Set the new/updated Contract Certificate (including the certificate chain)
and the corresponding encrypted private key. Should be forwared to EVCC.
This is an async response to a previously published iso15118_certificate_request
arguments:
certificate_response:
description: The response raw exi stream and the status from the CSMS system
type: object
$ref: /iso15118_charger#/ResponseExiStreamStatus
vars:
iso15118_certificate_request:
description: >-
The vehicle requests the SECC to deliver the certificate that belong
to the currently valid contract of the vehicle.
Response will be reported async via set_get_certificate_response
type: object
$ref: /iso15118_charger#/RequestExiStreamSchema
5 changes: 0 additions & 5 deletions modules/DummyV2G/main/ISO15118_chargerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ void ISO15118_chargerImpl::handle_session_setup(std::vector<types::iso15118_char
// your code for cmd session_setup goes here
}

void ISO15118_chargerImpl::handle_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& exi_stream_status) {
// your code for cmd certificate_response goes here
}

void ISO15118_chargerImpl::handle_authorization_response(
types::authorization::AuthorizationStatus& authorization_status,
types::authorization::CertificateStatus& certificate_status) {
Expand Down
2 changes: 0 additions & 2 deletions modules/DummyV2G/main/ISO15118_chargerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase {
virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override;
virtual void handle_session_setup(std::vector<types::iso15118_charger::PaymentOption>& payment_options,
bool& supported_certificate_service) override;
virtual void
handle_certificate_response(types::iso15118_charger::ResponseExiStreamStatus& exi_stream_status) override;
virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status,
types::authorization::CertificateStatus& certificate_status) override;
virtual void handle_ac_contactor_closed(bool& status) override;
Expand Down
1 change: 1 addition & 0 deletions modules/Evse15118D20/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target_link_libraries(${MODULE_NAME}
target_sources(${MODULE_NAME}
PRIVATE
"charger/ISO15118_chargerImpl.cpp"
"extensions/iso15118_extensionsImpl.cpp"
)

# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
Expand Down
2 changes: 2 additions & 0 deletions modules/Evse15118D20/Evse15118D20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ namespace module {

void Evse15118D20::init() {
invoke_init(*p_charger);
invoke_init(*p_extensions);
}

void Evse15118D20::ready() {
invoke_ready(*p_charger);
invoke_ready(*p_extensions);
}

} // namespace module
7 changes: 5 additions & 2 deletions modules/Evse15118D20/Evse15118D20.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

// headers for provided interface implementations
#include <generated/interfaces/ISO15118_charger/Implementation.hpp>
#include <generated/interfaces/iso15118_extensions/Implementation.hpp>

// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1
// insert your custom include headers here
Expand All @@ -36,10 +37,12 @@ struct Conf {
class Evse15118D20 : public Everest::ModuleBase {
public:
Evse15118D20() = delete;
Evse15118D20(const ModuleInfo& info, std::unique_ptr<ISO15118_chargerImplBase> p_charger, Conf& config) :
ModuleBase(info), p_charger(std::move(p_charger)), config(config){};
Evse15118D20(const ModuleInfo& info, std::unique_ptr<ISO15118_chargerImplBase> p_charger,
std::unique_ptr<iso15118_extensionsImplBase> p_extensions, Conf& config) :
ModuleBase(info), p_charger(std::move(p_charger)), p_extensions(std::move(p_extensions)), config(config){};

const std::unique_ptr<ISO15118_chargerImplBase> p_charger;
const std::unique_ptr<iso15118_extensionsImplBase> p_extensions;
const Conf& config;

// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1
Expand Down
5 changes: 0 additions & 5 deletions modules/Evse15118D20/charger/ISO15118_chargerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,6 @@ void ISO15118_chargerImpl::handle_session_setup(std::vector<types::iso15118_char
setup_steps_done.set(to_underlying_value(SetupStep::AUTH_SETUP));
}

void ISO15118_chargerImpl::handle_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& exi_stream_status) {
// your code for cmd certificate_response goes here
}

void ISO15118_chargerImpl::handle_authorization_response(
types::authorization::AuthorizationStatus& authorization_status,
types::authorization::CertificateStatus& certificate_status) {
Expand Down
2 changes: 0 additions & 2 deletions modules/Evse15118D20/charger/ISO15118_chargerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase {
virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override;
virtual void handle_session_setup(std::vector<types::iso15118_charger::PaymentOption>& payment_options,
bool& supported_certificate_service) override;
virtual void
handle_certificate_response(types::iso15118_charger::ResponseExiStreamStatus& exi_stream_status) override;
virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status,
types::authorization::CertificateStatus& certificate_status) override;
virtual void handle_ac_contactor_closed(bool& status) override;
Expand Down
21 changes: 21 additions & 0 deletions modules/Evse15118D20/extensions/iso15118_extensionsImpl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest

#include "iso15118_extensionsImpl.hpp"

namespace module {
namespace extensions {

void iso15118_extensionsImpl::init() {
}

void iso15118_extensionsImpl::ready() {
}

void iso15118_extensionsImpl::handle_set_get_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& certificate_response) {
// your code for cmd set_get_certificate_response goes here
}

} // namespace extensions
} // namespace module
62 changes: 62 additions & 0 deletions modules/Evse15118D20/extensions/iso15118_extensionsImpl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest
#ifndef extensions_ISO15118_EXTENSIONS_IMPL_HPP
#define extensions_ISO15118_EXTENSIONS_IMPL_HPP

//
// AUTO GENERATED - MARKED REGIONS WILL BE KEPT
// template version 3
//

#include <generated/interfaces/iso15118_extensions/Implementation.hpp>

#include "../Evse15118D20.hpp"

// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1
// insert your custom include headers here
// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1

namespace module {
namespace extensions {

struct Conf {};

class iso15118_extensionsImpl : public iso15118_extensionsImplBase {
public:
iso15118_extensionsImpl() = delete;
iso15118_extensionsImpl(Everest::ModuleAdapter* ev, const Everest::PtrContainer<Evse15118D20>& mod, Conf& config) :
iso15118_extensionsImplBase(ev, "extensions"), mod(mod), config(config){};

// ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1
// insert your public definitions here
// ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1

protected:
// command handler functions (virtual)
virtual void handle_set_get_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& certificate_response) override;

// ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1
// insert your protected definitions here
// ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1

private:
const Everest::PtrContainer<Evse15118D20>& mod;
const Conf& config;

virtual void init() override;
virtual void ready() override;

// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1
// insert your private definitions here
// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1
};

// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1
// insert other definitions here
// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1

} // namespace extensions
} // namespace module

#endif // extensions_ISO15118_EXTENSIONS_IMPL_HPP
5 changes: 5 additions & 0 deletions modules/Evse15118D20/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ provides:
interface: ISO15118_charger
description: >-
This interface provides limited access to iso15118-20
extensions:
interface: iso15118_extensions
description: >-
This interface is used to share data between ISO15118 and OCPP modules
to support the requirements of the OCPP protocol
enable_external_mqtt: false
metadata:
license: https://opensource.org/licenses/Apache-2.0
Expand Down
4 changes: 0 additions & 4 deletions modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,6 @@ void EvseManager::ready() {
switch_AC_mode();
});
}

r_hlc[0]->subscribe_certificate_request([this](types::iso15118_charger::RequestExiStreamSchema request) {
p_evse->publish_iso15118_certificate_request(request);
});
}

bsp->signal_event.connect([this](const CPEvent event) {
Expand Down
5 changes: 0 additions & 5 deletions modules/EvseManager/evse/evse_managerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,6 @@ bool evse_managerImpl::handle_stop_transaction(types::evse_manager::StopTransact
return mod->charger->cancel_transaction(request);
};

void evse_managerImpl::handle_set_get_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& certificate_reponse) {
mod->r_hlc[0]->call_certificate_response(certificate_reponse);
}

bool evse_managerImpl::handle_external_ready_to_start_charging() {
if (mod->config.external_ready_to_start_charging) {
EVLOG_info << "Received external ready to start charging command.";
Expand Down
2 changes: 0 additions & 2 deletions modules/EvseManager/evse/evse_managerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class evse_managerImpl : public evse_managerImplBase {
virtual bool handle_resume_charging() override;
virtual bool handle_stop_transaction(types::evse_manager::StopTransactionRequest& request) override;
virtual bool handle_force_unlock(int& connector_id) override;
virtual void handle_set_get_certificate_response(
types::iso15118_charger::ResponseExiStreamStatus& certificate_response) override;
virtual bool handle_external_ready_to_start_charging() override;

// ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1
Expand Down
3 changes: 0 additions & 3 deletions modules/EvseManager/tests/EvseManagerStub.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ struct evse_managerImplStub : public evse_managerImplBase {
handle_switch_three_phases_while_charging(bool& three_phases) {
return types::evse_manager::SwitchThreePhasesWhileChargingResult::Success;
}
virtual void
handle_set_get_certificate_response(types::iso15118_charger::ResponseExiStreamStatus& certificate_response) {
}
virtual bool handle_external_ready_to_start_charging() {
return true;
}
Expand Down
1 change: 1 addition & 0 deletions modules/EvseV2G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endif()
target_sources(${MODULE_NAME}
PRIVATE
"charger/ISO15118_chargerImpl.cpp"
"extensions/iso15118_extensionsImpl.cpp"
)

# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
Expand Down
4 changes: 3 additions & 1 deletion modules/EvseV2G/EvseV2G.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace module {

void EvseV2G::init() {
/* create v2g context */
v2g_ctx = v2g_ctx_create(&(*p_charger), &(*r_security));
v2g_ctx = v2g_ctx_create(&(*p_charger), &(*p_extensions), &(*r_security));

if (v2g_ctx == nullptr)
return;
Expand All @@ -49,6 +49,7 @@ void EvseV2G::init() {
#endif // EVEREST_MBED_TLS

invoke_init(*p_charger);
invoke_init(*p_extensions);
}

void EvseV2G::ready() {
Expand Down Expand Up @@ -79,6 +80,7 @@ void EvseV2G::ready() {
}

invoke_ready(*p_charger);
invoke_ready(*p_extensions);

rv = sdp_listen(v2g_ctx);

Expand Down
Loading