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';
requestPayload: JsonType
): Promise<void> {
if (chargingStation.isRegistered() || commandName === OCPP16RequestCommand.BOOT_NOTIFICATION) {
- if (this.responseHandlers.has(commandName)) {
+ if (
+ this.responseHandlers.has(commandName) &&
+ ChargingStationUtils.isRequestCommandSupported(commandName, chargingStation)
+ ) {
try {
await this.responseHandlers.get(commandName)(chargingStation, payload, requestPayload);
} catch (error) {
// Throw exception
throw new OCPPError(
ErrorType.NOT_IMPLEMENTED,
- `${commandName} is not implemented to handle request response payload ${JSON.stringify(
+ `${commandName} is not implemented to handle request response PDU ${JSON.stringify(
payload,
null,
2
} else {
throw new OCPPError(
ErrorType.SECURITY_ERROR,
- `${commandName} cannot be issued to handle request response payload ${JSON.stringify(
+ `${commandName} cannot be issued to handle request response PDU ${JSON.stringify(
payload,
null,
2