import type { ConnectorStatus } from '../types/ConnectorStatus';
import { FileType } from '../types/FileType';
import type { JsonType } from '../types/JsonType';
-import { ChargePointErrorCode } from '../types/ocpp/ChargePointErrorCode';
import { ChargingProfile, ChargingRateUnitType } from '../types/ocpp/ChargingProfile';
import {
ConnectorPhaseRotation,
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { OCPPVersion } from '../../../types/ocpp/OCPPVersion';
import type { IncomingRequestHandler } from '../../../types/ocpp/Requests';
-import type { DefaultResponse } from '../../../types/ocpp/Responses';
+import type { GenericResponse } from '../../../types/ocpp/Responses';
import Constants from '../../../utils/Constants';
import logger from '../../../utils/Logger';
import Utils from '../../../utils/Utils';
private handleRequestReset(
chargingStation: ChargingStation,
commandPayload: ResetRequest
- ): DefaultResponse {
+ ): GenericResponse {
this.asyncResource
.runInAsyncScope(
chargingStation.reset.bind(chargingStation) as (
private async handleRequestRemoteStartTransaction(
chargingStation: ChargingStation,
commandPayload: RemoteStartTransactionRequest
- ): Promise<DefaultResponse> {
+ ): Promise<GenericResponse> {
const transactionConnectorId = commandPayload.connectorId;
if (chargingStation.connectors.has(transactionConnectorId) === true) {
const remoteStartTransactionLogMsg =
chargingStation: ChargingStation,
connectorId: number,
idTag: string
- ): Promise<DefaultResponse> {
+ ): Promise<GenericResponse> {
if (
chargingStation.getConnectorStatus(connectorId).status !== OCPP16ChargePointStatus.AVAILABLE
) {
private async handleRequestRemoteStopTransaction(
chargingStation: ChargingStation,
commandPayload: RemoteStopTransactionRequest
- ): Promise<DefaultResponse> {
+ ): Promise<GenericResponse> {
const transactionId = commandPayload.transactionId;
for (const connectorId of chargingStation.connectors.keys()) {
if (
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { OCPPVersion } from '../../../types/ocpp/OCPPVersion';
import {
- type DefaultResponse,
+ type GenericResponse,
RegistrationStatusEnumType,
type ResponseHandler,
} from '../../../types/ocpp/Responses';
this.jsonIncomingRequestResponseSchemas = new Map([
[
OCPP16IncomingRequestCommand.RESET,
- this.parseJsonSchemaFile<DefaultResponse>(
+ this.parseJsonSchemaFile<GenericResponse>(
'../../../assets/json-schemas/ocpp/1.6/ResetResponse.json'
),
],
[
OCPP16IncomingRequestCommand.CLEAR_CACHE,
- this.parseJsonSchemaFile<DefaultResponse>(
+ this.parseJsonSchemaFile<GenericResponse>(
'../../../assets/json-schemas/ocpp/1.6/ClearCacheResponse.json'
),
],
],
[
OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION,
- this.parseJsonSchemaFile<DefaultResponse>(
+ this.parseJsonSchemaFile<GenericResponse>(
'../../../assets/json-schemas/ocpp/1.6/RemoteStartTransactionResponse.json'
),
],
[
OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION,
- this.parseJsonSchemaFile<DefaultResponse>(
+ this.parseJsonSchemaFile<GenericResponse>(
'../../../assets/json-schemas/ocpp/1.6/RemoteStopTransactionResponse.json'
),
],
ClearChargingProfileStatus,
ConfigurationStatus,
DataTransferStatus,
- DefaultStatus,
+ GenericStatus,
TriggerMessageStatus,
UnlockStatus,
} from '../../types/ocpp/Responses';
export default class OCPPConstants {
static readonly OCPP_RESPONSE_EMPTY = Object.freeze({});
- static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: DefaultStatus.ACCEPTED });
- static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: DefaultStatus.REJECTED });
+ static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: GenericStatus.ACCEPTED });
+ static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: GenericStatus.REJECTED });
static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED = Object.freeze({
status: ConfigurationStatus.ACCEPTED,
import type { EmptyObject } from '../../EmptyObject';
import type { JsonObject } from '../../JsonType';
-import type { DefaultStatus, RegistrationStatusEnumType } from '../Responses';
+import type { GenericStatus, RegistrationStatusEnumType } from '../Responses';
export type StatusInfoType = {
reasonCode: string;
} & JsonObject;
export type OCPP20ClearCacheResponse = {
- status: DefaultStatus;
+ status: GenericStatus;
statusInfo?: StatusInfoType;
} & JsonObject;
export type HeartbeatResponse = OCPP16HeartbeatResponse;
-export type ClearCacheResponse = DefaultResponse | OCPP20ClearCacheResponse;
+export type ClearCacheResponse = GenericResponse | OCPP20ClearCacheResponse;
export type StatusNotificationResponse =
| OCPP16StatusNotificationResponse
export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse;
-export enum DefaultStatus {
+export enum GenericStatus {
ACCEPTED = 'Accepted',
REJECTED = 'Rejected',
}
-export type DefaultResponse = {
- status: DefaultStatus;
+export type GenericResponse = {
+ status: GenericStatus;
};
export enum RegistrationStatusEnumType {