X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPServiceUtils.ts;h=26b7a4ee5ccc4db42c48209eade339d08e2bf941;hb=1bf29f5be7c0ffe3d029e447ecb50da55bfd8948;hp=1225f4e1113fced99ae3fd27bf96020e123c8bd7;hpb=60a743910478b70e39dcefa5e1b752ec8a93880e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index 1225f4e1..26b7a4ee 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -166,6 +166,14 @@ export class OCPPServiceUtils { } } + public static startHeartbeatInterval(chargingStation: ChargingStation, interval: number): void { + if (!chargingStation.heartbeatSetInterval) { + chargingStation.startHeartbeat(); + } else if (chargingStation.getHeartbeatInterval() !== interval) { + chargingStation.restartHeartbeat(); + } + } + protected static parseJsonSchemaFile( filePath: string, ocppVersion: OCPPVersion,