X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FUIHttpServer.ts;h=85dbccdfe6ca5f79c10e360391f3b358f7aef871;hb=6501eda9e69fff639911308b3f2de26593ae18c9;hp=103a27aed75c163ef7481035ae2eef681ac6b81a;hpb=a37fc6dc8267e22b2b2d35773525980b81f014e8;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index 103a27ae..85dbccdf 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -6,6 +6,7 @@ import { AbstractUIServer } from './AbstractUIServer'; import { UIServerUtils } from './UIServerUtils'; import { BaseError } from '../../exception'; import { + ApplicationProtocolVersion, type ProcedureName, type Protocol, type ProtocolRequest, @@ -43,9 +44,12 @@ export class UIHttpServer extends AbstractUIServer { this.startHttpServer(); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars public sendRequest(request: ProtocolRequest): void { - // This is intentionally left blank + switch (this.uiServerConfiguration.version) { + case ApplicationProtocolVersion.VERSION_20: + this.httpServer.emit('request', request); + break; + } } public sendResponse(response: ProtocolResponse): void { @@ -129,10 +133,10 @@ export class UIHttpServer extends AbstractUIServer { this.buildProtocolRequest( uuid, procedureName, - body ?? Constants.EMPTY_FREEZED_OBJECT, + body ?? Constants.EMPTY_FROZEN_OBJECT, ), ) - .then((protocolResponse: ProtocolResponse | undefined) => { + .then((protocolResponse?: ProtocolResponse) => { if (!isNullOrUndefined(protocolResponse)) { this.sendResponse(protocolResponse!); }