Skip to content

Commit

Permalink
Refactoring iso15118 EVerest types (EVerest#1050)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
SebaLukas authored Feb 17, 2025
1 parent 7e5cabb commit 0c6449f
Show file tree
Hide file tree
Showing 48 changed files with 1,971 additions and 1,227 deletions.
40 changes: 20 additions & 20 deletions interfaces/ISO15118_charger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions interfaces/ISO15118_ev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions interfaces/iso15118_extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ 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: >-
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
$ref: /iso15118#/RequestExiStreamSchema
23 changes: 10 additions & 13 deletions modules/DummyV2G/main/ISO15118_chargerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ void ISO15118_chargerImpl::ready() {
}

void ISO15118_chargerImpl::handle_setup(
types::iso15118_charger::EVSEID& evse_id,
std::vector<types::iso15118_charger::SupportedEnergyMode>& supported_energy_transfer_modes,
types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) {
types::iso15118::EVSEID& evse_id,
std::vector<types::iso15118::SupportedEnergyMode>& 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<types::iso15118_charger::PaymentOption>& payment_options,
void ISO15118_chargerImpl::handle_session_setup(std::vector<types::iso15118::PaymentOption>& payment_options,
bool& supported_certificate_service) {
// your code for cmd session_setup goes here
}
Expand Down Expand Up @@ -59,30 +58,28 @@ 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
}

void ISO15118_chargerImpl::handle_update_meter_info(types::powermeter::Powermeter& powermeter) {
// 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
}

Expand Down
23 changes: 11 additions & 12 deletions modules/DummyV2G/main/ISO15118_chargerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<types::iso15118_charger::SupportedEnergyMode>& 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<types::iso15118_charger::PaymentOption>& payment_options,
virtual void handle_setup(types::iso15118::EVSEID& evse_id,
std::vector<types::iso15118::SupportedEnergyMode>& 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<types::iso15118::PaymentOption>& payment_options,
bool& supported_certificate_service) override;
virtual void handle_authorization_response(types::authorization::AuthorizationStatus& authorization_status,
types::authorization::CertificateStatus& certificate_status) override;
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions modules/EvManager/main/car_simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 0c6449f

Please sign in to comment.