X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FAbstractUIServer.ts;h=8552a572f4bf08ab3134da682f3c444f2aa54773;hb=fca8bc64968004b4018a4d766b2121ced4fee943;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..8552a572 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,10 @@ 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 sendRequestOnBroadcastChannel(request: ProtocolRequest): Promise { + const protocolVersion = ProtocolVersion['0.0.1']; + this.registerProtocolVersionUIService(protocolVersion); + return this.uiServices.get(protocolVersion)?.requestHandler(request); } protected startHttpServer(): void {