ProtocolCommand,
ProtocolRequest,
ProtocolRequestHandler,
+ ProtocolVersion,
} from '../../../types/UIProtocol';
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
import { AbstractUIServer } from '../AbstractUIServer';
export default abstract class AbstractUIService {
+ protected readonly version: ProtocolVersion;
protected readonly uiServer: AbstractUIServer;
protected readonly messageHandlers: Map<ProtocolCommand, ProtocolRequestHandler>;
- constructor(uiServer: AbstractUIServer) {
+ constructor(uiServer: AbstractUIServer, version: ProtocolVersion) {
+ this.version = version;
this.uiServer = uiServer;
this.messageHandlers = new Map<ProtocolCommand, ProtocolRequestHandler>([
[ProtocolCommand.LIST_CHARGING_STATIONS, this.handleListChargingStations.bind(this)],
import { JsonType } from '../../../types/JsonType';
-import { ProtocolCommand, ProtocolRequestHandler } from '../../../types/UIProtocol';
+import {
+ ProtocolCommand,
+ ProtocolRequestHandler,
+ ProtocolVersion,
+} from '../../../types/UIProtocol';
import { AbstractUIServer } from '../AbstractUIServer';
import AbstractUIService from './AbstractUIService';
export default class UIService001 extends AbstractUIService {
constructor(uiServer: AbstractUIServer) {
- super(uiServer);
+ super(uiServer, ProtocolVersion['0.0.1']);
this.messageHandlers.set(
ProtocolCommand.START_TRANSACTION,
this.handleStartTransaction.bind(this) as ProtocolRequestHandler