Skip to content

Conversation

@Dalachowsky
Copy link

@Dalachowsky Dalachowsky commented Jan 16, 2026

Describe your changes

Added ChargeParameterDiscovery req/res with tests.

There are still a couple of TODOs in the convert functions regarding the array bounds checking. These will be resolved after we decide on how to handle this in #1678.

Because these messages can get quite complex and are quite different in AC and DC charging, the tests were split into multiple cases. Testing the SASchedules was also split into separate test, because this structure gets deep and complicated.

Issue ticket number and link

#1727

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@SebaLukas SebaLukas self-assigned this Jan 16, 2026
@SebaLukas SebaLukas changed the title Draft: libiso15118: d2: ChargeParameterDiscovery libiso15118: d2: ChargeParameterDiscovery Jan 16, 2026
@SebaLukas SebaLukas marked this pull request as draft January 16, 2026 09:03
@SebaLukas SebaLukas force-pushed the feat/adding-iso2-support branch from 26677a9 to e21ac4a Compare January 22, 2026 09:47
@SebaLukas SebaLukas linked an issue Jan 30, 2026 that may be closed by this pull request
@SebaLukas SebaLukas marked this pull request as ready for review January 30, 2026 07:46
@SebaLukas SebaLukas linked an issue Jan 30, 2026 that may be closed by this pull request
@SebaLukas SebaLukas removed a link to an issue Jan 30, 2026
@Dalachowsky Dalachowsky force-pushed the feat/adding-iso2-support-charge-parameter-discovery branch from 3e7b5e4 to 5c7dded Compare February 3, 2026 05:58
Added ChargeParameterDiscovery req/res with tests.
There are still a couple of TODOs in the convert functions.
These will be resolved after settling the conversation
in EVerest#1678.

Signed-off-by: Kacper Dalach <[email protected]>
Added bounds checking for ChargeParameterDiscovery
messages.

Signed-off-by: Kacper Dalach <[email protected]>
@Dalachowsky Dalachowsky force-pushed the feat/adding-iso2-support-charge-parameter-discovery branch from 5c7dded to 73f3a93 Compare February 3, 2026 13:34
Copy link
Member

@SebaLukas SebaLukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good 👍
See my comments

Comment on lines +122 to +123
std::optional<data_types::AcEvChargeParameter> ac_ev_charge_parameter;
std::optional<data_types::DcEvChargeParameter> dc_ev_charge_parameter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of two optionals I would like to have one std::variant with the Ac and DC EvChargeParameter.

Comment on lines +132 to +133
std::optional<data_types::AcEvseChargeParameter> ac_evse_charge_parameter;
std::optional<data_types::DcEvseChargeParameter> dc_evse_charge_parameter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

auto& schedule_out = out.SAScheduleList.SAScheduleTuple.array[i];
convert(schedule_in, schedule_out);
}
out.SAScheduleList.SAScheduleTuple.arrayLen = in.sa_schedule_list->size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be sa_schedule_list_max_length, not in.sa_schedule_list->size()

entry_out.RelativeTimeInterval_isUsed = true;
convert(entry_in.p_max, entry_out.PMax);
}
out.PMaxSchedule.PMaxScheduleEntry.arrayLen = in.pmax_schedule.size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pmax_schedule_max_length instead of .size()

auto& entry_out = out.SalesTariff.SalesTariffEntry.array[i];
convert(entry_in, entry_out);
}
out.SalesTariff.SalesTariffEntry.arrayLen = in.sales_tariff->sales_tariff_entry.size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

auto& cost_out = out.ConsumptionCost.array[i];
convert(cost_in, cost_out);
}
out.ConsumptionCost.arrayLen = in.consumption_cost.size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem

entry_out.amount = entry_in.amount;
CPP2CB_ASSIGN_IF_USED(entry_in.amount_multiplier, entry_out.amountMultiplier);
}
out.Cost.arrayLen = in.cost.size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ISO-2 ChargeParameterDiscovery

2 participants