private evsesConfigurationHash!: string
private automaticTransactionGeneratorConfiguration?: AutomaticTransactionGeneratorConfiguration
private ocppIncomingRequestService!: OCPPIncomingRequestService
- private acceptedEventListenerRegistered: boolean
private readonly messageBuffer: Set<string>
private configuredSupervisionUrl!: URL
private autoReconnectRetryCount: number
this.started = false
this.starting = false
this.stopping = false
- this.acceptedEventListenerRegistered = false
this.wsConnection = null
this.autoReconnectRetryCount = 0
this.index = index
this.on(ChargingStationEvents.updated, () => {
parentPort?.postMessage(buildUpdatedMessage(this))
})
+ this.on(ChargingStationEvents.accepted, () => {
+ this.startMessageSequence().catch(error => {
+ logger.error(`${this.logPrefix()} Error while starting the message sequence:`, error)
+ })
+ })
this.initialize()
}
return ocppConfiguration
}
- private registerAcceptedEventListener (): void {
- this.once(ChargingStationEvents.accepted, () => {
- this.startMessageSequence().catch(error => {
- logger.error(`${this.logPrefix()} Error while starting the message sequence:`, error)
- })
- this.acceptedEventListenerRegistered = false
- })
- this.acceptedEventListenerRegistered = true
- }
-
private async onOpen (): Promise<void> {
if (this.isWebSocketConnectionOpened()) {
logger.info(
this.stationInfo?.registrationMaxRetries === -1)
)
}
- if (!this.acceptedEventListenerRegistered) {
- this.registerAcceptedEventListener()
- }
if (this.isRegistered()) {
this.emit(ChargingStationEvents.registered)
if (this.inAcceptedState()) {