Skip to content

Commit 649b66a

Browse files
committed
[centralsystem] Add notification to IChargePoingHandler when an heartbeat message has been received
1 parent e80089c commit 649b66a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/centralsystem/chargepoint/ChargePointHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& reque
341341
// Empty request
342342
(void)request;
343343

344+
// Notify request
345+
if (m_handler)
346+
{
347+
m_handler->heartbeat();
348+
}
349+
344350
// Prepare response
345351
response.currentTime = DateTime::now();
346352

src/centralsystem/interface/IChargePointRequestHandler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class IChargePointRequestHandler
4444
/** @brief Called to notify the disconnection of the charge point */
4545
virtual void disconnected() = 0;
4646

47+
/**
48+
* @brief Called when an heartbeat has been received
49+
*/
50+
virtual void heartbeat() { }
51+
4752
/**
4853
* @brief Called to get authorization informations for an id tag
4954
* @param id_tag Id tag to check

0 commit comments

Comments
 (0)