// Start WebSocket ping
this.startWebSocketPing()
// Start heartbeat
- this.startHeartbeat()
+ if (this.heartbeatSetInterval == null) {
+ this.startHeartbeat()
+ } else if (this.getHeartbeatInterval() !== this.bootNotificationResponse?.interval) {
+ this.restartHeartbeat()
+ }
// Initialize connectors status
if (this.hasEvses) {
for (const [evseId, evseStatus] of this.evses) {
chargingStation: ChargingStation,
payload: OCPP16BootNotificationResponse
): void {
- if (payload.status === RegistrationStatusEnumType.ACCEPTED) {
- addConfigurationKey(
- chargingStation,
- OCPP16StandardParametersKey.HeartbeatInterval,
- payload.interval.toString(),
- {},
- { overwrite: true, save: true }
- )
- addConfigurationKey(
- chargingStation,
- OCPP16StandardParametersKey.HeartBeatInterval,
- payload.interval.toString(),
- { visible: false },
- { overwrite: true, save: true }
- )
- OCPP16ServiceUtils.startHeartbeatInterval(chargingStation, payload.interval)
- }
if (Object.values(RegistrationStatusEnumType).includes(payload.status)) {
chargingStation.bootNotificationResponse = payload
if (chargingStation.isRegistered()) {
chargingStation.emit(ChargingStationEvents.registered)
if (chargingStation.inAcceptedState()) {
chargingStation.emit(ChargingStationEvents.accepted)
+ addConfigurationKey(
+ chargingStation,
+ OCPP16StandardParametersKey.HeartbeatInterval,
+ payload.interval.toString(),
+ {},
+ { overwrite: true, save: true }
+ )
+ addConfigurationKey(
+ chargingStation,
+ OCPP16StandardParametersKey.HeartBeatInterval,
+ payload.interval.toString(),
+ { visible: false },
+ { overwrite: true, save: true }
+ )
}
} else if (chargingStation.inRejectedState()) {
chargingStation.emit(ChargingStationEvents.rejected)
chargingStation: ChargingStation,
payload: OCPP20BootNotificationResponse
): void {
- if (payload.status === RegistrationStatusEnumType.ACCEPTED) {
- addConfigurationKey(
- chargingStation,
- OCPP20OptionalVariableName.HeartbeatInterval,
- payload.interval.toString(),
- {},
- { overwrite: true, save: true }
- )
- OCPP20ServiceUtils.startHeartbeatInterval(chargingStation, payload.interval)
- }
if (Object.values(RegistrationStatusEnumType).includes(payload.status)) {
chargingStation.bootNotificationResponse = payload
if (chargingStation.isRegistered()) {
chargingStation.emit(ChargingStationEvents.registered)
if (chargingStation.inAcceptedState()) {
chargingStation.emit(ChargingStationEvents.accepted)
+ addConfigurationKey(
+ chargingStation,
+ OCPP20OptionalVariableName.HeartbeatInterval,
+ payload.interval.toString(),
+ {},
+ { overwrite: true, save: true }
+ )
}
} else if (chargingStation.inRejectedState()) {
chargingStation.emit(ChargingStationEvents.rejected)
}
}
- public static startHeartbeatInterval (chargingStation: ChargingStation, interval: number): void {
- if (chargingStation.heartbeatSetInterval == null) {
- chargingStation.startHeartbeat()
- } else if (chargingStation.getHeartbeatInterval() !== interval) {
- chargingStation.restartHeartbeat()
- }
- }
-
protected static parseJsonSchemaFile<T extends JsonType>(
relativePath: string,
ocppVersion: OCPPVersion,