X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPRequestService.ts;h=7b50b62a3de321a1212b99fbf935e6e0fe461128;hb=00db15b822b3f26f67fb36094daf7bd206c96fc2;hp=1430de0701cf5bcb356b484adc8581c812ec7725;hpb=3a33b6a907a44aabd721d3c63e6c5984f4f60c28;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 1430de07..7b50b62a 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -1,5 +1,4 @@ import { - DiagnosticsStatus, IncomingRequestCommand, RequestCommand, ResponseType, @@ -13,7 +12,6 @@ import { ErrorType } from '../../types/ocpp/ErrorType'; import { HandleErrorParams } from '../../types/Error'; import { JsonType } from '../../types/JsonType'; import { MessageType } from '../../types/ocpp/MessageType'; -import { MeterValue } from '../../types/ocpp/MeterValues'; import OCPPError from '../../exception/OCPPError'; import type OCPPResponseService from './OCPPResponseService'; import PerformanceStatistics from '../../performance/PerformanceStatistics'; @@ -43,13 +41,13 @@ export default abstract class OCPPRequestService { chargingStation: ChargingStation, ocppResponseService: OCPPResponseService ): T { - if (!OCPPRequestService.instances.has(chargingStation.id)) { + if (!OCPPRequestService.instances.has(chargingStation.hashId)) { OCPPRequestService.instances.set( - chargingStation.id, + chargingStation.hashId, new this(chargingStation, ocppResponseService) ); } - return OCPPRequestService.instances.get(chargingStation.id) as T; + return OCPPRequestService.instances.get(chargingStation.hashId) as T; } public async sendResult( @@ -212,7 +210,6 @@ export default abstract class OCPPRequestService { resolve(payload); } catch (error) { reject(error); - throw error; } finally { self.chargingStation.requests.delete(messageId); } @@ -318,13 +315,9 @@ export default abstract class OCPPRequestService { } } - public abstract sendMessageHandler( + public abstract sendMessageHandler( commandName: RequestCommand, commandParams?: JsonType, params?: SendParams - ): Promise; - - public abstract sendDiagnosticsStatusNotification( - diagnosticsStatus: DiagnosticsStatus - ): Promise; + ): Promise; }