+ logger.warn(this.chargingStation.logPrefix() + ' Charging station rejected by the central server');
+ }
+ }
+
+ private handleResponseHeartbeat(payload: HeartbeatResponse, requestPayload: HeartbeatRequest): void {
+ logger.debug(this.chargingStation.logPrefix() + ' Heartbeat response received: %j to Heartbeat request: %j', payload, requestPayload);
+ }
+
+ private handleResponseAuthorize(payload: OCPP16AuthorizeResponse, requestPayload: AuthorizeRequest): void {
+ let authorizeConnectorId: number;
+ for (const connectorId of this.chargingStation.connectors.keys()) {
+ if (connectorId > 0 && this.chargingStation.getConnectorStatus(connectorId)?.authorizeIdTag === requestPayload.idTag) {
+ authorizeConnectorId = connectorId;
+ break;
+ }
+ }
+ if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
+ this.chargingStation.getConnectorStatus(authorizeConnectorId).authorized = true;
+ logger.debug(`${this.chargingStation.logPrefix()} IdTag ${requestPayload.idTag} authorized on connector ${authorizeConnectorId}`);
+ } else {
+ this.chargingStation.getConnectorStatus(authorizeConnectorId).authorized = false;
+ delete this.chargingStation.getConnectorStatus(authorizeConnectorId).authorizeIdTag;
+ logger.debug(`${this.chargingStation.logPrefix()} IdTag ${requestPayload.idTag} refused with status ${payload.idTagInfo.status} on connector ${authorizeConnectorId}`);