commandName: OCPP16IncomingRequestCommand,
commandPayload: JsonType
): Promise<void> {
- let result: JsonType;
+ let response: JsonType;
if (
this.chargingStation.getOcppStrictCompliance() &&
this.chargingStation.isInPendingState() &&
) {
if (this.incomingRequestHandlers.has(commandName)) {
try {
- // Call the method to build the result
- result = await this.incomingRequestHandlers.get(commandName)(commandPayload);
+ // Call the method to build the response
+ response = await this.incomingRequestHandlers.get(commandName)(commandPayload);
} catch (error) {
// Log
logger.error(this.chargingStation.logPrefix() + ' Handle request error: %j', error);
commandName
);
}
- // Send the built result
- await this.chargingStation.ocppRequestService.sendResult(messageId, result, commandName);
+ // Send the built response
+ await this.chargingStation.ocppRequestService.sendResponse(messageId, response, commandName);
}
// Simulate charging station restart
this.chargingStation = chargingStation;
this.ocppResponseService = ocppResponseService;
this.requestHandler.bind(this);
- this.sendResult.bind(this);
+ this.sendResponse.bind(this);
this.sendError.bind(this);
}
return OCPPRequestService.instances.get(chargingStation.hashId) as T;
}
- public async sendResult(
+ public async sendResponse(
messageId: string,
messagePayload: JsonType,
commandName: IncomingRequestCommand
): Promise<ResponseType> {
try {
- // Send result message
+ // Send response message
return await this.internalSendMessage(
messageId,
messagePayload,