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 (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.SmartCharging)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to set charging profile(s) without '${
+ OCPP16SupportedFeatureProfiles.SmartCharging
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ 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 (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.SmartCharging)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to clear charging profile(s) without '${
+ OCPP16SupportedFeatureProfiles.SmartCharging
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ 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 (
+ !this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.FirmwareManagement)
+ ) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to get diagnostics without '${
+ OCPP16SupportedFeatureProfiles.FirmwareManagement
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_RESPONSE_EMPTY;
+ }
logger.debug(
this.chargingStation.logPrefix() +
' ' +
private handleRequestTriggerMessage(
commandPayload: OCPP16TriggerMessageRequest
): OCPP16TriggerMessageResponse {
+ if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.RemoteTrigger)) {
+ logger.error(
+ `${this.chargingStation.logPrefix()} Trying to remote trigger message without '${
+ OCPP16SupportedFeatureProfiles.RemoteTrigger
+ }' feature enabled in ${
+ OCPP16StandardParametersKey.SupportedFeatureProfiles
+ } in configuration`
+ );
+ return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
+ }
try {
switch (commandPayload.requestedMessage) {
case MessageTrigger.BootNotification: