OCPP16MeterValuesRequest,
OCPP16MeterValuesResponse,
} from '../../../types/ocpp/1.6/MeterValues';
+import {
+ OCPP16StandardParametersKey,
+ OCPP16SupportedFeatureProfiles,
+} from '../../../types/ocpp/1.6/Configuration';
import type ChargingStation from '../../ChargingStation';
import Constants from '../../../utils/Constants';
import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
-import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration';
import { OCPPConfigurationKey } from '../../../types/ocpp/Configuration';
import OCPPError from '../../../exception/OCPPError';
import OCPPIncomingRequestService from '../OCPPIncomingRequestService';
private handleRequestSetChargingProfile(
commandPayload: SetChargingProfileRequest
): SetChargingProfileResponse {
+ if (
+ !OCPP16ServiceUtils.checkFeatureProfile(
+ this.chargingStation,
+ OCPP16SupportedFeatureProfiles.SmartCharging,
+ OCPP16IncomingRequestCommand.SET_CHARGING_PROFILE
+ )
+ ) {
+ return Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED;
+ }
if (!this.chargingStation.getConnectorStatus(commandPayload.connectorId)) {
logger.error(
`${this.chargingStation.logPrefix()} Trying to set charging profile(s) to a non existing connector Id ${
private handleRequestClearChargingProfile(
commandPayload: ClearChargingProfileRequest
): ClearChargingProfileResponse {
+ if (
+ !OCPP16ServiceUtils.checkFeatureProfile(
+ this.chargingStation,
+ OCPP16SupportedFeatureProfiles.SmartCharging,
+ OCPP16IncomingRequestCommand.CLEAR_CHARGING_PROFILE
+ )
+ ) {
+ return Constants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN;
+ }
const connectorStatus = this.chargingStation.getConnectorStatus(commandPayload.connectorId);
if (!connectorStatus) {
logger.error(
private async handleRequestGetDiagnostics(
commandPayload: GetDiagnosticsRequest
): Promise<GetDiagnosticsResponse> {
+ if (
+ !OCPP16ServiceUtils.checkFeatureProfile(
+ this.chargingStation,
+ OCPP16SupportedFeatureProfiles.FirmwareManagement,
+ OCPP16IncomingRequestCommand.GET_DIAGNOSTICS
+ )
+ ) {
+ return Constants.OCPP_RESPONSE_EMPTY;
+ }
logger.debug(
this.chargingStation.logPrefix() +
' ' +
private handleRequestTriggerMessage(
commandPayload: OCPP16TriggerMessageRequest
): OCPP16TriggerMessageResponse {
+ if (
+ !OCPP16ServiceUtils.checkFeatureProfile(
+ this.chargingStation,
+ OCPP16SupportedFeatureProfiles.RemoteTrigger,
+ OCPP16IncomingRequestCommand.TRIGGER_MESSAGE
+ )
+ ) {
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
+ }
try {
switch (commandPayload.requestedMessage) {
case MessageTrigger.BootNotification: