if (response.status === GenericStatus.Accepted) {
const { connectorId, idTag } = request
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- chargingStation.getConnectorStatus(connectorId)!.transactionRemoteStarted = true
+ chargingStation.getConnectorStatus(connectorId!)!.transactionRemoteStarted = true
chargingStation.ocppRequestService
.requestHandler<Partial<OCPP16StartTransactionRequest>, OCPP16StartTransactionResponse>(
chargingStation,
chargingStation: ChargingStation,
commandPayload: RemoteStartTransactionRequest
): Promise<GenericResponse> {
+ if (commandPayload.connectorId == null) {
+ do {
+ commandPayload.connectorId = randomInt(1, chargingStation.getNumberOfConnectors())
+ } while (
+ chargingStation.getConnectorStatus(commandPayload.connectorId)?.transactionStarted === true
+ )
+ }
const { connectorId: transactionConnectorId, idTag, chargingProfile } = commandPayload
if (!chargingStation.hasConnector(transactionConnectorId)) {
return this.notifyRemoteStartTransactionRejected(
`${chargingStation.logPrefix()} ${moduleName}.handleIncomingRequestError: Incoming request command '${commandName}' error:`,
error
)
- console.error('params set', params)
if (params.throwError === false && params.errorResponse != null) {
return params.errorResponse
}