this.connectorsStatus.get(connectorId).acceptedAuthorizeRequests++;
logger.info(this.logPrefix(connectorId) + ' start transaction for idTag ' + idTag);
// Start transaction
- startResponse = await this.chargingStation.ocppRequestService.sendStartTransaction(
- connectorId,
- idTag
- );
+ startResponse = (await this.chargingStation.ocppRequestService.sendMessageHandler(
+ RequestCommand.START_TRANSACTION,
+ {
+ connectorId,
+ idTag,
+ }
+ )) as StartTransactionResponse;
PerformanceStatistics.endMeasure(measureId, beginId);
return startResponse;
}
}
logger.info(this.logPrefix(connectorId) + ' start transaction for idTag ' + idTag);
// Start transaction
- startResponse = await this.chargingStation.ocppRequestService.sendStartTransaction(
- connectorId,
- idTag
- );
+ startResponse = (await this.chargingStation.ocppRequestService.sendMessageHandler(
+ RequestCommand.START_TRANSACTION,
+ {
+ connectorId,
+ idTag,
+ }
+ )) as StartTransactionResponse;
PerformanceStatistics.endMeasure(measureId, beginId);
return startResponse;
}
logger.info(this.logPrefix(connectorId) + ' start transaction without an idTag');
- startResponse = await this.chargingStation.ocppRequestService.sendStartTransaction(connectorId);
+ startResponse = (await this.chargingStation.ocppRequestService.sendMessageHandler(
+ RequestCommand.START_TRANSACTION,
+ { connectorId }
+ )) as StartTransactionResponse;
PerformanceStatistics.endMeasure(measureId, beginId);
return startResponse;
}
import {
OCPP16AuthorizationStatus,
OCPP16AuthorizeResponse,
+ OCPP16StartTransactionResponse,
OCPP16StopTransactionReason,
} from '../../../types/ocpp/1.6/Transaction';
).transactionRemoteStarted = true;
if (
(
- await this.chargingStation.ocppRequestService.sendStartTransaction(
- transactionConnectorId,
- commandPayload.idTag
- )
+ (await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.START_TRANSACTION,
+ {
+ connectorId: transactionConnectorId,
+ idTag: commandPayload.idTag,
+ }
+ )) as OCPP16StartTransactionResponse
).idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED
) {
logger.debug(
true;
if (
(
- await this.chargingStation.ocppRequestService.sendStartTransaction(
- transactionConnectorId,
- commandPayload.idTag
- )
+ (await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.START_TRANSACTION,
+ {
+ connectorId: transactionConnectorId,
+ idTag: commandPayload.idTag,
+ }
+ )) as OCPP16StartTransactionResponse
).idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED
) {
logger.debug(
);
}
- public async sendStartTransaction(
- connectorId: number,
- idTag?: string
- ): Promise<OCPP16StartTransactionResponse> {
- const payload: StartTransactionRequest = {
- connectorId,
- ...(!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.DEFAULT_IDTAG }),
- meterStart: this.chargingStation.getEnergyActiveImportRegisterByConnectorId(connectorId),
- timestamp: new Date().toISOString(),
- };
- return (await this.sendMessage(
- Utils.generateUUID(),
- payload,
- OCPP16RequestCommand.START_TRANSACTION
- )) as OCPP16StartTransactionResponse;
- }
-
public async sendStopTransaction(
transactionId: number,
meterStop: number,
ResponseType,
SendParams,
} from '../../types/ocpp/Requests';
-import {
- StartTransactionResponse,
- StopTransactionReason,
- StopTransactionResponse,
-} from '../../types/ocpp/Transaction';
+import { StopTransactionReason, StopTransactionResponse } from '../../types/ocpp/Transaction';
import type ChargingStation from '../ChargingStation';
import Constants from '../../utils/Constants';
params?: SendParams
): Promise<ResponseType>;
- public abstract sendStartTransaction(
- connectorId: number,
- idTag?: string
- ): Promise<StartTransactionResponse>;
-
public abstract sendStopTransaction(
transactionId: number,
meterStop: number,