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

Fixed GetCompositeScheduleRequest invalid optional access #910

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

alexandrecarrillo
Copy link
Contributor

Describe your changes

Fixed an issue in GetCompositeScheduleRequest command handler.

When the optional field chargingRateUnit is not included in the message request, the handler attempts to read an empty optional value and throws an std::bad_optional_access exception.

OCPP Version

OCPP2.0.1

Describe your solution

When this optional field is missing in the request, the value to use will be the first supported charging rate unit defined in the device model (ChargingScheduleChargingRateUnit).

Otherwise if no valid unit is defined in this variable, the request must be rejected.

Checklist before requesting a review

Signed-off-by: Alexandre Carrillo <[email protected]>
@hikinggrass hikinggrass merged commit 5a7a008 into main Dec 13, 2024
8 checks passed
@hikinggrass hikinggrass deleted the ac-get-composite-schedule branch December 13, 2024 14:35
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.

3 participants