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 (ChargingStationUtils.isRequestCommandSupported(commandName, chargingStation)) {
+ if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName) === true) {
const requestPayload = this.buildRequestPayload<RequestType>(
chargingStation,
commandName,
params
)) as unknown as ResponseType;
}
+ // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError().
throw new OCPPError(
ErrorType.NOT_SUPPORTED,
`Unsupported OCPP command '${commandName}'`,
}),
} as unknown as Request;
default:
+ // OCPPError usage here is debatable: it's an error in the OCPP stack but not targeted to sendError().
throw new OCPPError(
ErrorType.NOT_SUPPORTED,
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions