X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPRequestService.ts;h=f89567064467af1f276ab91322e8af9e2570a881;hb=73d09045dec38f798d93b28ad11e76f78d65c7cb;hp=7b20343a33471aa560989f005948cdc4c142dadd;hpb=5e5a3ab74af7dde544b51b7ef368b593bb957ed6;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 7b20343a..f8956706 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -35,7 +35,7 @@ export default abstract class OCPPRequestService { // Request case MessageType.CALL_MESSAGE: // Build request - this.chargingStation.requests[messageId] = [responseCallback, rejectCallback, commandParams as Record]; + this.chargingStation.requests.set(messageId, [responseCallback, rejectCallback, commandParams as Record]); messageToSend = JSON.stringify([messageType, messageId, commandName, commandParams]); break; // Response @@ -100,7 +100,7 @@ export default abstract class OCPPRequestService { logger.debug(`${self.chargingStation.logPrefix()} Error: %j occurred when calling command %s with parameters: %j`, error, commandName, commandParams); // Build Exception // eslint-disable-next-line no-empty-function - self.chargingStation.requests[messageId] = [() => { }, () => { }, {}]; + self.chargingStation.requests.set(messageId, [() => { }, () => { }, {}]); // Send error reject(error); }