Commit | Line | Data |
---|---|---|
8c476a1f | 1 | import { ChargingProfileStatus, ConfigurationStatus, DefaultStatus, UnlockStatus } from '../types/ocpp/1.6/RequestResponses'; |
9ac86a7e | 2 | |
3f40bc9c | 3 | export default class Constants { |
10570d97 JB |
4 | static readonly ENTITY_CHARGING_STATION = 'ChargingStation'; |
5 | static readonly ENTITY_AUTOMATIC_TRANSACTION_GENERATOR = 'AutomaticTransactionGenerator'; | |
6 | ||
7 | static readonly WS_UNSUPPORTED_DATA = 1007; | |
8 | ||
f738a0e9 JB |
9 | static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: DefaultStatus.ACCEPTED }); |
10 | static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: DefaultStatus.REJECTED }); | |
9ac86a7e JB |
11 | static readonly OCPP_CONFIGURATION_RESPONSE_ACCEPTED = Object.freeze({ status: ConfigurationStatus.ACCEPTED }); |
12 | static readonly OCPP_CONFIGURATION_RESPONSE_REJECTED = Object.freeze({ status: ConfigurationStatus.REJECTED }); | |
13 | static readonly OCPP_CONFIGURATION_RESPONSE_REBOOT_REQUIRED = Object.freeze({ status: ConfigurationStatus.REBOOT_REQUIRED }); | |
14 | static readonly OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED = Object.freeze({ status: ConfigurationStatus.NOT_SUPPORTED }); | |
8c476a1f JB |
15 | static readonly OCPP_CHARGING_PROFILE_RESPONSE_ACCEPTED = Object.freeze({ status: ChargingProfileStatus.ACCEPTED }); |
16 | static readonly OCPP_CHARGING_PROFILE_RESPONSE_REJECTED = Object.freeze({ status: ChargingProfileStatus.REJECTED }); | |
17 | static readonly OCPP_CHARGING_PROFILE_RESPONSE_NOT_SUPPORTED = Object.freeze({ status: ChargingProfileStatus.NOT_SUPPORTED }); | |
9ac86a7e JB |
18 | static readonly OCPP_RESPONSE_UNLOCKED = Object.freeze({ status: UnlockStatus.UNLOCKED }); |
19 | static readonly OCPP_RESPONSE_UNLOCK_FAILED = Object.freeze({ status: UnlockStatus.UNLOCK_FAILED }); | |
20 | static readonly OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED = Object.freeze({ status: UnlockStatus.NOT_SUPPORTED }); | |
10570d97 JB |
21 | static readonly OCPP_SOCKET_TIMEOUT = 60000; // 60 sec |
22 | static readonly OCPP_JSON_CALL_MESSAGE = 2; // Caller to callee | |
23 | static readonly OCPP_JSON_CALL_RESULT_MESSAGE = 3; // Callee to caller | |
24 | static readonly OCPP_JSON_CALL_ERROR_MESSAGE = 4; // Callee to caller | |
7dde0b73 | 25 | // Requested Action is not known by receiver |
10570d97 | 26 | static readonly OCPP_ERROR_NOT_IMPLEMENTED = 'NotImplemented'; |
7dde0b73 | 27 | // Requested Action is recognized but not supported by the receiver |
10570d97 | 28 | static readonly OCPP_ERROR_NOT_SUPPORTED = 'NotSupported'; |
7dde0b73 | 29 | // An internal error occurred and the receiver was not able to process the requested Action successfully |
10570d97 | 30 | static readonly OCPP_ERROR_INTERNAL_ERROR = 'InternalError'; |
7dde0b73 | 31 | // Payload for Action is incomplete |
10570d97 | 32 | static readonly OCPP_ERROR_PROTOCOL_ERROR = 'ProtocolError'; |
7dde0b73 | 33 | // During the processing of Action a security issue occurred preventing receiver from completing the Action successfully |
10570d97 | 34 | static readonly OCPP_ERROR_SECURITY_ERROR = 'SecurityError'; |
7dde0b73 | 35 | // Payload for Action is syntactically incorrect or not conform the PDU structure for Action |
10570d97 | 36 | static readonly OCPP_ERROR_FORMATION_VIOLATION = 'FormationViolation'; |
7dde0b73 | 37 | // Payload is syntactically correct but at least one field contains an invalid value |
10570d97 | 38 | static readonly OCPP_ERROR_PROPERTY_RAINT_VIOLATION = 'PropertyraintViolation'; |
7f134aca | 39 | // Payload for Action is syntactically correct but at least one of the fields violates occurrence raints |
10570d97 | 40 | static readonly OCPP_ERROR_OCCURENCE_RAINT_VIOLATION = 'OccurenceraintViolation'; |
6526f8c8 | 41 | // Payload for Action is syntactically correct but at least one of the fields violates data type raints (e.g. “somestring” = 12) |
10570d97 | 42 | static readonly OCPP_ERROR_TYPERAINT_VIOLATION = 'TyperaintViolation'; |
7dde0b73 | 43 | // Any other error not covered by the previous ones |
10570d97 | 44 | static readonly OCPP_ERROR_GENERIC_ERROR = 'GenericError'; |
2e6f5966 | 45 | |
10570d97 JB |
46 | static readonly OCPP_PROTOCOL_JSON = 'json'; |
47 | static readonly OCPP_PROTOCOL_SOAP = 'soap'; | |
48 | static readonly OCPP_VERSION_12 = '1.2'; | |
49 | static readonly OCPP_VERSION_15 = '1.5'; | |
50 | static readonly OCPP_VERSION_16 = '1.6'; | |
51 | static readonly OCPP_VERSION_20 = '2.0'; | |
0a60c33c | 52 | |
10570d97 JB |
53 | static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms |
54 | static readonly CHARGING_STATION_ATG_WAIT_TIME = 2000; // Ms | |
9ac86a7e JB |
55 | |
56 | static readonly TRANSACTION_DEFAULT_IDTAG = '00000000'; | |
f7869514 | 57 | } |