// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export class OCPPServiceUtils {
- public static getMessageTypeString = getMessageTypeString
- public static sendAndSetConnectorStatus = sendAndSetConnectorStatus
- public static isIdTagAuthorized = isIdTagAuthorized
- public static buildTransactionEndMeterValue = buildTransactionEndMeterValue
+ public static readonly getMessageTypeString = getMessageTypeString
+ public static readonly sendAndSetConnectorStatus = sendAndSetConnectorStatus
+ public static readonly isIdTagAuthorized = isIdTagAuthorized
+ public static readonly buildTransactionEndMeterValue = buildTransactionEndMeterValue
protected static getSampledValueTemplate = getSampledValueTemplate
protected static buildSampledValue = buildSampledValue
// This is intentional
}
- public static handleProtocols = (
+ public static readonly handleProtocols = (
protocols: Set<string>,
request: IncomingMessage
): string | false => {
return false
}
- public static isProtocolAndVersionSupported = (protocolStr: string): boolean => {
+ public static readonly isProtocolAndVersionSupported = (protocolStr: string): boolean => {
const [protocol, version] = UIServerUtils.getProtocolAndVersion(protocolStr)
return (
Object.values(Protocol).includes(protocol) && Object.values(ProtocolVersion).includes(version)
)
}
- public static getProtocolAndVersion = (protocolStr: string): [Protocol, ProtocolVersion] => {
+ public static readonly getProtocolAndVersion = (
+ protocolStr: string
+ ): [Protocol, ProtocolVersion] => {
const protocolIndex = protocolStr.indexOf(Protocol.UI)
const protocol = protocolStr.substring(
protocolIndex,