]);
}
- public async handleRequest(
+ public async incomingRequestHandler(
messageId: string,
commandName: OCPP16IncomingRequestCommand,
commandPayload: JsonType
connectorId,
this.chargingStation.getEnergyActiveImportRegisterByTransactionId(transactionId)
);
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse
>(OCPP16RequestCommand.METER_VALUES, {
meterValue: transactionEndMeterValue,
});
}
- const stopResponse = await this.chargingStation.ocppRequestService.sendMessageHandler<
+ const stopResponse = await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StopTransactionRequest,
OCPP16StopTransactionResponse
>(OCPP16RequestCommand.STOP_TRANSACTION, {
}
return Constants.OCPP_RESPONSE_UNLOCK_FAILED;
}
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
}
this.chargingStation.getConnectorStatus(id).availability = commandPayload.type;
if (response === Constants.OCPP_AVAILABILITY_RESPONSE_ACCEPTED) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
return Constants.OCPP_AVAILABILITY_RESPONSE_SCHEDULED;
}
this.chargingStation.getConnectorStatus(connectorId).availability = commandPayload.type;
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
const transactionConnectorId = commandPayload.connectorId;
const connectorStatus = this.chargingStation.getConnectorStatus(transactionConnectorId);
if (transactionConnectorId) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
} else if (this.chargingStation.getMayAuthorizeAtRemoteStart()) {
connectorStatus.authorizeIdTag = commandPayload.idTag;
const authorizeResponse: OCPP16AuthorizeResponse =
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16AuthorizeRequest,
OCPP16AuthorizeResponse
>(OCPP16RequestCommand.AUTHORIZE, {
connectorStatus.transactionRemoteStarted = true;
if (
(
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StartTransactionRequest,
OCPP16StartTransactionResponse
>(OCPP16RequestCommand.START_TRANSACTION, {
connectorStatus.transactionRemoteStarted = true;
if (
(
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StartTransactionRequest,
OCPP16StartTransactionResponse
>(OCPP16RequestCommand.START_TRANSACTION, {
this.chargingStation.getConnectorStatus(connectorId).status !==
OCPP16ChargePointStatus.AVAILABLE
) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId > 0 &&
this.chargingStation.getConnectorStatus(connectorId)?.transactionId === transactionId
) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId,
this.chargingStation.getEnergyActiveImportRegisterByTransactionId(transactionId)
);
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse
>(OCPP16RequestCommand.METER_VALUES, {
meterValue: transactionEndMeterValue,
});
}
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
OCPP16StopTransactionRequest,
OCPP16StopTransactionResponse
>(OCPP16RequestCommand.STOP_TRANSACTION, {
info.bytes / 1024
} bytes transferred from diagnostics archive ${info.name}`
);
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
DiagnosticsStatusNotificationRequest,
DiagnosticsStatusNotificationResponse
>(OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
uri.pathname + diagnosticsArchive
);
if (uploadResponse.code === 226) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
DiagnosticsStatusNotificationRequest,
DiagnosticsStatusNotificationResponse
>(OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
OCPP16IncomingRequestCommand.GET_DIAGNOSTICS
);
} catch (error) {
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
DiagnosticsStatusNotificationRequest,
DiagnosticsStatusNotificationResponse
>(OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
uri.protocol
} to transfer the diagnostic logs archive`
);
- await this.chargingStation.ocppRequestService.sendMessageHandler<
+ await this.chargingStation.ocppRequestService.requestHandler<
DiagnosticsStatusNotificationRequest,
DiagnosticsStatusNotificationResponse
>(OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
case MessageTrigger.BootNotification:
setTimeout(() => {
this.chargingStation.ocppRequestService
- .sendMessageHandler<OCPP16BootNotificationRequest, OCPP16BootNotificationResponse>(
+ .requestHandler<OCPP16BootNotificationRequest, OCPP16BootNotificationResponse>(
OCPP16RequestCommand.BOOT_NOTIFICATION,
{
chargePointModel:
case MessageTrigger.Heartbeat:
setTimeout(() => {
this.chargingStation.ocppRequestService
- .sendMessageHandler<OCPP16HeartbeatRequest, OCPP16HeartbeatResponse>(
+ .requestHandler<OCPP16HeartbeatRequest, OCPP16HeartbeatResponse>(
OCPP16RequestCommand.HEARTBEAT,
null,
{