X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPIncomingRequestService.ts;h=b5f607f534abb3e98a8dfa0c1eb8842740fc88c6;hb=0bb3ee612a9c58ca7828f309eb94e5b4af5ababe;hp=0d56ebe84e502cc717d44e2229ac3702f039e18d;hpb=e7aeea18e189dd087c8f951cf77a253e2818ae90;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPIncomingRequestService.ts b/src/charging-station/ocpp/OCPPIncomingRequestService.ts index 0d56ebe8..b5f607f5 100644 --- a/src/charging-station/ocpp/OCPPIncomingRequestService.ts +++ b/src/charging-station/ocpp/OCPPIncomingRequestService.ts @@ -9,6 +9,7 @@ export default abstract class OCPPIncomingRequestService { string, OCPPIncomingRequestService >(); + protected chargingStation: ChargingStation; protected constructor(chargingStation: ChargingStation) { @@ -19,10 +20,10 @@ export default abstract class OCPPIncomingRequestService { this: new (chargingStation: ChargingStation) => T, chargingStation: ChargingStation ): T { - if (!OCPPIncomingRequestService.instances.has(chargingStation.id)) { - OCPPIncomingRequestService.instances.set(chargingStation.id, new this(chargingStation)); + if (!OCPPIncomingRequestService.instances.has(chargingStation.hashId)) { + OCPPIncomingRequestService.instances.set(chargingStation.hashId, new this(chargingStation)); } - return OCPPIncomingRequestService.instances.get(chargingStation.id) as T; + return OCPPIncomingRequestService.instances.get(chargingStation.hashId) as T; } protected handleIncomingRequestError( @@ -46,7 +47,7 @@ export default abstract class OCPPIncomingRequestService { } } - public abstract handleRequest( + public abstract incomingRequestHandler( messageId: string, commandName: IncomingRequestCommand, commandPayload: JsonType