) {
if (
this.incomingRequestHandlers.has(commandName) &&
- OCPP16ServiceUtils.isIncomingRequestCommandSupported(commandName, chargingStation)
+ OCPP16ServiceUtils.isIncomingRequestCommandSupported(chargingStation, commandName)
) {
try {
this.validatePayload(chargingStation, commandName, commandPayload);
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
import type ChargingStation from '../../ChargingStation';
-import { ChargingStationUtils } from '../../ChargingStationUtils';
import OCPPRequestService from '../OCPPRequestService';
import type OCPPResponseService from '../OCPPResponseService';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
commandParams?: JsonType,
params?: RequestParams
): Promise<ResponseType> {
- if (OCPP16ServiceUtils.isRequestCommandSupported(commandName, chargingStation)) {
+ if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName)) {
const requestPayload = this.buildRequestPayload<RequestType>(
chargingStation,
commandName,
import Utils from '../../../utils/Utils';
import type ChargingStation from '../../ChargingStation';
import { ChargingStationConfigurationUtils } from '../../ChargingStationConfigurationUtils';
-import { ChargingStationUtils } from '../../ChargingStationUtils';
import OCPPResponseService from '../OCPPResponseService';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
if (chargingStation.isRegistered() || commandName === OCPP16RequestCommand.BOOT_NOTIFICATION) {
if (
this.responseHandlers.has(commandName) &&
- OCPP16ServiceUtils.isRequestCommandSupported(commandName, chargingStation)
+ OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName)
) {
try {
this.validatePayload(chargingStation, commandName, payload);
}
public static isRequestCommandSupported(
- command: RequestCommand,
- chargingStation: ChargingStation
+ chargingStation: ChargingStation,
+ command: RequestCommand
): boolean {
const isRequestCommand = Object.values(RequestCommand).includes(command);
if (
}
public static isIncomingRequestCommandSupported(
- command: IncomingRequestCommand,
- chargingStation: ChargingStation
+ chargingStation: ChargingStation,
+ command: IncomingRequestCommand
): boolean {
const isIncomingRequestCommand = Object.values(IncomingRequestCommand).includes(command);
if (
}
public start(): void {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
this.webSocketServer.on('connection', (ws: WebSocket, req: IncomingMessage): void => {
if (UIServerUtils.isProtocolAndVersionSupported(ws.protocol) === false) {
logger.error(