diff --git a/interfaces/evse_board_support.yaml b/interfaces/evse_board_support.yaml index b968b1473..80f49b194 100644 --- a/interfaces/evse_board_support.yaml +++ b/interfaces/evse_board_support.yaml @@ -129,5 +129,9 @@ vars: need to be implemented and the returned value is not used in those cases. type: object $ref: /board_support_common#/ProximityPilot + request_stop_transaction: + description: Publish to stop the transaction gracefully (e.g. user pressed the stop button) + type: object + $ref: /evse_manager#/StopTransactionRequest errors: - reference: /errors/evse_board_support diff --git a/modules/EvseManager/EvseManager.cpp b/modules/EvseManager/EvseManager.cpp index 8f8cd9798..a57ff9339 100644 --- a/modules/EvseManager/EvseManager.cpp +++ b/modules/EvseManager/EvseManager.cpp @@ -112,6 +112,9 @@ void EvseManager::init() { [this](const auto& caps) { update_powersupply_capabilities(caps); }); } } + + r_bsp->subscribe_request_stop_transaction( + [this](types::evse_manager::StopTransactionRequest r) { charger->cancel_transaction(r); }); } void EvseManager::ready() {