let startResponse: StartTransactionResponse;
if (this.chargingStation.hasAuthorizedTags()) {
const idTag = this.chargingStation.getRandomIdTag();
+ const startTransactionLogMsg = `${this.logPrefix(
+ connectorId
+ )} start transaction for idTag '${idTag}'`;
if (this.getRequireAuthorize()) {
this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag = idTag;
// Authorize idTag
this.connectorsStatus.get(connectorId).authorizeRequests++;
if (authorizeResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
this.connectorsStatus.get(connectorId).acceptedAuthorizeRequests++;
- logger.info(this.logPrefix(connectorId) + ' start transaction for idTag ' + idTag);
+ logger.info(startTransactionLogMsg);
// Start transaction
startResponse = await this.chargingStation.ocppRequestService.requestHandler<
StartTransactionRequest,
PerformanceStatistics.endMeasure(measureId, beginId);
return authorizeResponse;
}
- logger.info(this.logPrefix(connectorId) + ' start transaction for idTag ' + idTag);
+ logger.info(startTransactionLogMsg);
// Start transaction
startResponse = await this.chargingStation.ocppRequestService.requestHandler<
StartTransactionRequest,
PerformanceStatistics.endMeasure(measureId, beginId);
return startResponse;
}
- logger.info(this.logPrefix(connectorId) + ' start transaction without an idTag');
+ logger.info(`${this.logPrefix(connectorId)} start transaction without an idTag`);
startResponse = await this.chargingStation.ocppRequestService.requestHandler<
StartTransactionRequest,
StartTransactionResponse
chargingStation.stationInfo.chargingStationId +
'#' +
transactionConnectorId.toString() +
- ' for idTag ' +
- commandPayload.idTag
+ " for idTag '" +
+ commandPayload.idTag +
+ "'"
);
return Constants.OCPP_RESPONSE_ACCEPTED;
}
chargingStation.stationInfo.chargingStationId +
'#' +
transactionConnectorId.toString() +
- ' for idTag ' +
- commandPayload.idTag
+ " for idTag '" +
+ commandPayload.idTag +
+ "'"
);
return Constants.OCPP_RESPONSE_ACCEPTED;
}
if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
chargingStation.getConnectorStatus(authorizeConnectorId).idTagAuthorized = true;
logger.debug(
- `${chargingStation.logPrefix()} IdTag ${
+ `${chargingStation.logPrefix()} IdTag '${
requestPayload.idTag
- } authorized on connector ${authorizeConnectorId}`
+ }' authorized on connector ${authorizeConnectorId}`
);
} else {
chargingStation.getConnectorStatus(authorizeConnectorId).idTagAuthorized = false;
delete chargingStation.getConnectorStatus(authorizeConnectorId).authorizeIdTag;
logger.debug(
- `${chargingStation.logPrefix()} IdTag ${requestPayload.idTag} refused with status '${
+ `${chargingStation.logPrefix()} IdTag '${requestPayload.idTag}' refused with status '${
payload.idTagInfo.status
}' on connector ${authorizeConnectorId}`
);
chargingStation.stationInfo.chargingStationId +
'#' +
connectorId.toString() +
- ' for idTag ' +
- requestPayload.idTag
+ " for idTag '" +
+ requestPayload.idTag +
+ "'"
);
if (chargingStation.stationInfo.powerSharedByConnectors) {
chargingStation.powerDivider++;
resolve: (value: ResponsePayload | PromiseLike<ResponsePayload>) => void,
reject: (reason?: any) => void
): void {
- this._responseHandlers.set(id, { resolve, reject, procedureName });
+ this._responseHandlers.set(id, { procedureName, resolve, reject });
}
private getResponseHandler(id: string): ResponseHandler | undefined {