return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
}
- private handleRequestClearCache(chargingStation: ChargingStation): DefaultResponse {
- chargingStation.authorizedTagsCache.deleteAuthorizedTags(
- ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo)
- );
- return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
- }
-
private async handleRequestUnlockConnector(
chargingStation: ChargingStation,
commandPayload: UnlockConnectorRequest
}),
} as unknown as Request;
case OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION:
+ case OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION:
return {
status: commandParams?.status,
} as unknown as Request;
} as unknown as Request;
case OCPP16RequestCommand.DATA_TRANSFER:
return commandParams as unknown as Request;
- case OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION:
- return {
- status: commandParams?.status,
- } 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(
OCPP20ClearCacheRequest,
OCPP20IncomingRequestCommand,
} from '../../../types/ocpp/2.0/Requests';
-import type { OCPP20ClearCacheResponse } from '../../../types/ocpp/2.0/Responses';
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { OCPPVersion } from '../../../types/ocpp/OCPPVersion';
import type { IncomingRequestHandler } from '../../../types/ocpp/Requests';
import logger from '../../../utils/Logger';
import type ChargingStation from '../../ChargingStation';
-import { ChargingStationUtils } from '../../ChargingStationUtils';
-import OCPPConstants from '../OCPPConstants';
import OCPPIncomingRequestService from '../OCPPIncomingRequestService';
import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
);
return false;
}
-
- private handleRequestClearCache(chargingStation: ChargingStation): OCPP20ClearCacheResponse {
- chargingStation.authorizedTagsCache.deleteAuthorizedTags(
- ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo)
- );
- return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
- }
}
import type { JsonObject, JsonType } from '../../types/JsonType';
import type { OCPPVersion } from '../../types/ocpp/OCPPVersion';
import type { IncomingRequestCommand } from '../../types/ocpp/Requests';
+import type { ClearCacheResponse } from '../../types/ocpp/Responses';
import logger from '../../utils/Logger';
import type ChargingStation from '../ChargingStation';
+import { ChargingStationUtils } from '../ChargingStationUtils';
+import OCPPConstants from './OCPPConstants';
import { OCPPServiceUtils } from './OCPPServiceUtils';
const moduleName = 'OCPPIncomingRequestService';
);
}
+ protected handleRequestClearCache(chargingStation: ChargingStation): ClearCacheResponse {
+ chargingStation.authorizedTagsCache.deleteAuthorizedTags(
+ ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo)
+ );
+ return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
+ }
+
public abstract incomingRequestHandler(
chargingStation: ChargingStation,
messageId: string,
OCPP16TriggerMessageStatus,
OCPP16UnlockStatus,
} from './1.6/Responses';
-import type { OCPP20BootNotificationResponse } from './2.0/Responses';
+import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses';
import type { ErrorType } from './ErrorType';
import type { MessageType } from './MessageType';
export type HeartbeatResponse = OCPP16HeartbeatResponse;
+export type ClearCacheResponse = DefaultResponse | OCPP20ClearCacheResponse;
+
export type StatusNotificationResponse = OCPP16StatusNotificationResponse;
export type MeterValuesResponse = OCPP16MeterValuesResponse;