X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPConstants.ts;h=e4ac8d7ffce43dbfa19a66ade823e6792ed3df9d;hb=be34dba565184fc320ac7621688ee5a35659e712;hp=f2f36cec2a280f75f01c1bf36be861abaa28361d;hpb=bf53cadfde620fe89e6438403658682feb5bd39e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPConstants.ts b/src/charging-station/ocpp/OCPPConstants.ts index f2f36cec..e4ac8d7f 100644 --- a/src/charging-station/ocpp/OCPPConstants.ts +++ b/src/charging-station/ocpp/OCPPConstants.ts @@ -4,15 +4,20 @@ import { ClearChargingProfileStatus, ConfigurationStatus, DataTransferStatus, - DefaultStatus, + GenericStatus, TriggerMessageStatus, UnlockStatus, -} from '../../types/ocpp/Responses'; +} from '../../types'; +import { Constants } from '../../utils'; -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 }); +export class OCPPConstants { + static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms + static readonly OCPP_TRIGGER_MESSAGE_DELAY = 500; // Ms + + static readonly OCPP_REQUEST_EMPTY = Constants.EMPTY_FREEZED_OBJECT; + static readonly OCPP_RESPONSE_EMPTY = Constants.EMPTY_FREEZED_OBJECT; + 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, @@ -87,7 +92,7 @@ export default class OCPPConstants { status: DataTransferStatus.REJECTED, }); - private constructor() { + protected constructor() { // This is intentional } }