this.stationInfo?.registrationMaxRetries === -1)
)
}
- if (this.isRegistered()) {
- this.emit(ChargingStationEvents.registered)
- if (this.inAcceptedState()) {
- this.emit(ChargingStationEvents.accepted)
- }
- } else {
- if (this.inRejectedState()) {
- this.emit(ChargingStationEvents.rejected)
- }
+ if (!this.isRegistered()) {
logger.error(
`${this.logPrefix()} Registration failure: maximum retries reached (${registrationRetryCount}) or retry disabled (${
this.stationInfo?.registrationMaxRetries
import { OCPPError } from '../../../exception/index.js'
import {
type ChangeConfigurationResponse,
+ ChargingStationEvents,
ErrorType,
type GenericResponse,
type GetConfigurationResponse,
OCPP16ServiceUtils.startHeartbeatInterval(chargingStation, payload.interval)
}
if (Object.values(RegistrationStatusEnumType).includes(payload.status)) {
+ if (chargingStation.isRegistered()) {
+ chargingStation.emit(ChargingStationEvents.registered)
+ if (chargingStation.inAcceptedState()) {
+ chargingStation.emit(ChargingStationEvents.accepted)
+ }
+ } else if (chargingStation.inRejectedState()) {
+ chargingStation.emit(ChargingStationEvents.rejected)
+ }
const logMsg = `${chargingStation.logPrefix()} Charging station in '${
payload.status
}' state on the central server`
import { addConfigurationKey, type ChargingStation } from '../../../charging-station/index.js'
import { OCPPError } from '../../../exception/index.js'
import {
+ ChargingStationEvents,
ErrorType,
type JsonType,
type OCPP20BootNotificationResponse,
OCPP20ServiceUtils.startHeartbeatInterval(chargingStation, payload.interval)
}
if (Object.values(RegistrationStatusEnumType).includes(payload.status)) {
+ if (chargingStation.isRegistered()) {
+ chargingStation.emit(ChargingStationEvents.registered)
+ if (chargingStation.inAcceptedState()) {
+ chargingStation.emit(ChargingStationEvents.accepted)
+ }
+ } else if (chargingStation.inRejectedState()) {
+ chargingStation.emit(ChargingStationEvents.rejected)
+ }
const logMsg = `${chargingStation.logPrefix()} Charging station in '${
payload.status
}' state on the central server`