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

Support configurable TxStart and TxStop points #546

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Apr 1, 2024

Describe your changes

Changes to be able to support configurable TxStart and TxStop points.
This PR does not implement handling for configurable TxStart and TxStop points within libocpp, but it allows the consumer application to implement this by calling on_transaction_started and on_transaction_finished at the specified TxStart and TxStop points.

  • Handling TransactionEvent.conf for type==Updated (not only Started)
  • IdToken became optional for TransactionEvent(Started). To be able to support e.g. TxStartPoint EVConnected
  • Added on_authorized handler to report when an Evse has been authorized. This allows sending of TransactionEvent(Updated) with IdToken
  • Added trigger_reason as argument to on_charging_state_changed

Issue ticket number and link

The companion PR in everest-core: EVerest/everest-core#611 . The actual support for configurable TxStart and TxStop points is implemented there. The transaction_handler.hpp could be moved to libocpp at a later stage, to have support actual for configurable TxStart and TxStop points within libocpp.

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

@Pietfried Pietfried force-pushed the feature/ocpp201-support-configurable-tx-start-stop branch 2 times, most recently from 032fb2c to f32452a Compare April 3, 2024 13:48
@Pietfried Pietfried marked this pull request as ready for review April 3, 2024 13:50
@marcemmers marcemmers self-assigned this Apr 4, 2024
Copy link
Contributor

@marcemmers marcemmers left a comment

Choose a reason for hiding this comment

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

I think there are some use cases missing that we can support

@Pietfried Pietfried force-pushed the feature/ocpp201-support-configurable-tx-start-stop branch from e10059b to 03a8f6f Compare April 4, 2024 17:29
Copy link
Contributor

@hikinggrass hikinggrass left a comment

Choose a reason for hiding this comment

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

looks good, I agree with marcs comments, this could probably be addressed

Pietfried and others added 2 commits April 8, 2024 08:59
* Now also handling TransactionEvent.conf for Updated (not only Started)
* IdToken became optional for TransactionEvent(Started). To be able to support e.g. TxStartPoint EVConnected
* Added on_authorized handler to report when an Evse has been authorized. This allows sending of TransactionEvent(Updated) with IdToken
* Added trigger_reason as argument to on_charging_state_changed

Co-authored-by: marcemmers <[email protected]>
Signed-off-by: Piet Gömpel <[email protected]>
Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried force-pushed the feature/ocpp201-support-configurable-tx-start-stop branch from 03a8f6f to a95e494 Compare April 8, 2024 06:59
* Stopping transactions if running on multiple evses in case status is not Accepted

Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried requested a review from marcemmers April 8, 2024 07:53
} else {
// add every evse_id with active transaction and given token
for (const auto& [evse_id, evse] : this->evses) {
if (evse->get_transaction() != nullptr and evse->get_transaction()->id_token.has_value()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: get the transaction just once and then use that temporary variable.

@Pietfried Pietfried merged commit 0f471de into main Apr 9, 2024
4 checks passed
@Pietfried Pietfried deleted the feature/ocpp201-support-configurable-tx-start-stop branch April 9, 2024 14:17
folkengine pushed a commit to US-JOET/libocpp that referenced this pull request Apr 15, 2024
Changes to be able to support configurable TxStart and TxStop points:
* Now also handling TransactionEvent.conf for Updated (not only Started)
* IdToken became optional for TransactionEvent(Started). To be able to support e.g. TxStartPoint EVConnected
* Added on_authorized handler to report when an Evse has been authorized. This allows sending of TransactionEvent(Updated) with IdToken
* Added trigger_reason as argument to on_charging_state_changed
* make TxStartPoint and TxStopPoint RW and remove ParkingBayOccupancy from valuesList

---------

Signed-off-by: Piet Gömpel <[email protected]>
Signed-off-by: pietfried <[email protected]>
Co-authored-by: marcemmers <[email protected]>
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