Skip to content

[centralsystem] Add notification to IChargePoingHandler when an heartbeat message has been received #227

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

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/centralsystem/chargepoint/ChargePointHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& reque
// Empty request
(void)request;

// Notify request
if (m_handler)
{
m_handler->heartbeat();
}

// Prepare response
response.currentTime = DateTime::now();

Expand Down
5 changes: 5 additions & 0 deletions src/centralsystem/interface/IChargePointRequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class IChargePointRequestHandler
/** @brief Called to notify the disconnection of the charge point */
virtual void disconnected() = 0;

/**
* @brief Called when an heartbeat has been received
*/
virtual void heartbeat() { }

/**
* @brief Called to get authorization informations for an id tag
* @param id_tag Id tag to check
Expand Down
Loading