type ChargingStation,
ChargingStationConfigurationUtils,
ChargingStationUtils,
- MessageChannelUtils,
} from '../../../charging-station';
import { OCPPError } from '../../../exception';
import {
type OCPP16AuthorizeRequest,
type OCPP16AuthorizeResponse,
type OCPP16BootNotificationResponse,
+ type OCPP16CancelReservationResponse,
OCPP16ChargePointStatus,
type OCPP16DataTransferResponse,
type OCPP16DiagnosticsStatusNotificationResponse,
type OCPP16MeterValuesRequest,
type OCPP16MeterValuesResponse,
OCPP16RequestCommand,
+ type OCPP16ReserveNowResponse,
OCPP16StandardParametersKey,
type OCPP16StartTransactionRequest,
type OCPP16StartTransactionResponse,
type SetChargingProfileResponse,
type UnlockConnectorResponse,
} from '../../../types';
-import { Constants, Utils, logger } from '../../../utils';
+import { Constants, Utils, buildUpdatedMessage, logger } from '../../../utils';
import { OCPPResponseService } from '../OCPPResponseService';
const moduleName = 'OCPP16ResponseService';
'constructor'
),
],
+ [
+ OCPP16RequestCommand.RESERVE_NOW,
+ OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16ReserveNowResponse>(
+ 'assets/json-schemas/ocpp/1.6/ReserveNowResponse.json',
+ moduleName,
+ 'constructor'
+ ),
+ ],
+ [
+ OCPP16RequestCommand.CANCEL_RESERVATION,
+ OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16CancelReservationResponse>(
+ 'assets/json-schemas/ocpp/1.6/CancelReservationResponse.json',
+ moduleName,
+ 'constructor'
+ ),
+ ],
]);
this.jsonIncomingRequestResponseSchemas = new Map([
[
}#${transactionConnectorId.toString()} for idTag '${requestPayload.idTag}'`
);
if (chargingStation.stationInfo.powerSharedByConnectors) {
- chargingStation.powerDivider++;
+ ++chargingStation.powerDivider;
}
const configuredMeterValueSampleInterval =
ChargingStationConfigurationUtils.getConfigurationKey(
): Promise<void> {
ChargingStationUtils.resetConnectorStatus(chargingStation.getConnectorStatus(connectorId));
chargingStation.stopMeterValues(connectorId);
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
+ parentPort?.postMessage(buildUpdatedMessage(chargingStation));
if (
chargingStation.getConnectorStatus(connectorId)?.status !== OCPP16ChargePointStatus.Available
) {
chargingStation.getConnectorStatus(transactionConnectorId)
);
chargingStation.stopMeterValues(transactionConnectorId);
- parentPort?.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
+ parentPort?.postMessage(buildUpdatedMessage(chargingStation));
const logMsg = `${chargingStation.logPrefix()} Transaction with id ${requestPayload.transactionId.toString()} STOPPED on ${
chargingStation.stationInfo.chargingStationId
}#${transactionConnectorId?.toString()} with status '${