Skip to content

Commit 934f173

Browse files
author
WangLibo
committed
When the heartbeatInterval sent by the platform = 0, the local heartbeatInterval is used.
1 parent f11481a commit 934f173

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/chargepoint/status/StatusManager.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,15 @@ void StatusManager::bootNotificationProcess()
434434

435435
// Configure hearbeat
436436
std::chrono::seconds interval(boot_conf.interval);
437-
m_ocpp_config.heartbeatInterval(interval);
437+
if(boot_conf.interval == 0)
438+
{
439+
interval = m_ocpp_config.heartbeatInterval();
440+
}
441+
else
442+
{
443+
m_ocpp_config.heartbeatInterval(interval);
444+
}
445+
438446
m_heartbeat_timer.start(std::chrono::milliseconds(interval));
439447
}
440448
else
@@ -551,7 +559,15 @@ void StatusManager::sendBootNotification()
551559

552560
// Restart hearbeat timer
553561
std::chrono::seconds interval(boot_conf.interval);
554-
m_ocpp_config.heartbeatInterval(interval);
562+
if(boot_conf.interval == 0)
563+
{
564+
interval = m_ocpp_config.heartbeatInterval();
565+
}
566+
else
567+
{
568+
m_ocpp_config.heartbeatInterval(interval);
569+
}
570+
555571
m_heartbeat_timer.restart(std::chrono::milliseconds(interval));
556572

557573
// Save registration status

0 commit comments

Comments
 (0)