X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FAbstractUIServer.ts;h=e689441633b47e0c7a6b52cd4c90fb1de58221be;hb=d58b442097da31f8b974d51aef63c64470d9ab48;hp=2f6f950b938fd94e74557e4b4f3206d5ae0e2939;hpb=6bd808fd1dc554c8d55521b20a064447835ef04c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/AbstractUIServer.ts b/src/charging-station/ui-server/AbstractUIServer.ts index 2f6f950b..e6894416 100644 --- a/src/charging-station/ui-server/AbstractUIServer.ts +++ b/src/charging-station/ui-server/AbstractUIServer.ts @@ -11,7 +11,7 @@ import { type ProcedureName, type ProtocolRequest, type ProtocolResponse, - type ProtocolVersion, + ProtocolVersion, type RequestPayload, type ResponsePayload, type UIServerConfiguration, @@ -46,14 +46,14 @@ export abstract class AbstractUIServer { this.chargingStations.clear(); } - public async sendBroadcastChannelRequest( - id: string, - procedureName: ProcedureName, - requestPayload: RequestPayload - ): Promise { - for (const uiService of this.uiServices.values()) { - await uiService.requestHandler(this.buildProtocolRequest(id, procedureName, requestPayload)); - } + public async sendInternalRequest(request: ProtocolRequest): Promise { + const protocolVersion = ProtocolVersion['0.0.1']; + this.registerProtocolVersionUIService(protocolVersion); + return this.uiServices.get(protocolVersion)?.requestHandler(request); + } + + public hasResponseHandler(id: string): boolean { + return this.responseHandlers.has(id); } protected startHttpServer(): void {