feat(simulator): initial work on configuration components and variables
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Feb 2023 19:32:27 +0000 (20:32 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Feb 2023 19:32:27 +0000 (20:32 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/types/index.ts
src/types/ocpp/2.0/Variables.ts [new file with mode: 0644]
src/types/ocpp/Configuration.ts

index 5561b82b0943c2b9e7c2a23c5533ef944b9c2bc2..4866b5c5c241856a87db28f54851c6a6cfc9e507 100644 (file)
@@ -8,11 +8,11 @@ import {
   ErrorType,
   type JsonObject,
   type JsonType,
-  OCPP16StandardParametersKey,
   type OCPP20BootNotificationResponse,
   type OCPP20ClearCacheResponse,
   type OCPP20HeartbeatResponse,
   OCPP20IncomingRequestCommand,
+  OCPP20OptionalVariableName,
   OCPP20RequestCommand,
   type OCPP20StatusNotificationResponse,
   OCPPVersion,
@@ -161,18 +161,11 @@ export class OCPP20ResponseService extends OCPPResponseService {
     if (payload.status === RegistrationStatusEnumType.ACCEPTED) {
       ChargingStationConfigurationUtils.addConfigurationKey(
         chargingStation,
-        OCPP16StandardParametersKey.HeartbeatInterval,
+        OCPP20OptionalVariableName.HeartbeatInterval,
         payload.interval.toString(),
         {},
         { overwrite: true, save: true }
       );
-      ChargingStationConfigurationUtils.addConfigurationKey(
-        chargingStation,
-        OCPP16StandardParametersKey.HeartBeatInterval,
-        payload.interval.toString(),
-        { visible: false },
-        { overwrite: true, save: true }
-      );
       chargingStation.heartbeatSetInterval
         ? chargingStation.restartHeartbeat()
         : chargingStation.startHeartbeat();
index 1ca290d23de1c866861e42eaeccedeaac1f019dd..f0a947a4e30ae4ab4d579611e0985e0cf003df58 100644 (file)
@@ -21,6 +21,7 @@ export * from './ocpp/1.6/Responses';
 export * from './ocpp/1.6/Transaction';
 export * from './ocpp/2.0/Requests';
 export * from './ocpp/2.0/Responses';
+export * from './ocpp/2.0/Variables';
 export * from './orm/entities/PerformanceData';
 export * from './orm/entities/PerformanceRecord';
 export * from './AutomaticTransactionGenerator';
diff --git a/src/types/ocpp/2.0/Variables.ts b/src/types/ocpp/2.0/Variables.ts
new file mode 100644 (file)
index 0000000..3c70898
--- /dev/null
@@ -0,0 +1,60 @@
+export enum OCPP20ComponentName {
+  AlignedDataCtrlr = 'AlignedDataCtrlr',
+  AuthCacheCtrlr = 'AuthCacheCtrlr',
+  AuthCtrlr = 'AuthCtrlr',
+  CHAdeMOCtrlr = 'CHAdeMOCtrlr',
+  ClockCtrlr = 'ClockCtrlr',
+  CustomizationCtrlr = 'CustomizationCtrlr',
+  DeviceDataCtrlr = 'DeviceDataCtrlr',
+  DisplayMessageCtrlr = 'DisplayMessageCtrlr',
+  ISO15118Ctrlr = 'ISO15118Ctrlr',
+  LocalAuthListCtrlr = 'LocalAuthListCtrlr',
+  MonitoringCtrlr = 'MonitoringCtrlr',
+  OCPPCommCtrlr = 'OCPPCommCtrlr',
+  ReservationCtrlr = 'ReservationCtrlr',
+  SampledDataCtrlr = 'SampledDataCtrlr',
+  SecurityCtrlr = 'SecurityCtrlr',
+  SmartChargingCtrlr = 'SmartChargingCtrlr',
+  TariffCostCtrlr = 'TariffCostCtrlr',
+  TxCtrlr = 'TxCtrlr',
+}
+
+export enum OCPP20RequiredVariableName {
+  MessageTimeout = 'MessageTimeout',
+  FileTransferProtocols = 'FileTransferProtocols',
+  NetworkConfigurationPriority = 'NetworkConfigurationPriority',
+  NetworkProfileConnectionAttempts = 'NetworkProfileConnectionAttempts',
+  OfflineThreshold = 'OfflineThreshold',
+  MessageAttempts = 'TransactionEvent',
+  MessageAttemptInterval = 'MessageAttemptInterval',
+  UnlockOnEVSideDisconnect = 'UnlockOnEVSideDisconnect',
+  ResetRetries = 'ResetRetries',
+  ItemsPerMessage = 'ItemsPerMessage',
+  BytesPerMessage = 'BytesPerMessage',
+  DateTime = 'DateTime',
+  TimeSource = 'TimeSource',
+  OrganizationName = 'OrganizationName',
+  CertificateEntries = 'CertificateEntries',
+  SecurityProfile = 'SecurityProfile',
+  AuthorizeRemoteStart = 'AuthorizeRemoteStart',
+  LocalAuthorizeOffline = 'LocalAuthorizeOffline',
+  LocalPreAuthorize = 'LocalPreAuthorize',
+  EVConnectionTimeOut = 'EVConnectionTimeOut',
+  StopTxOnEVSideDisconnect = 'StopTxOnEVSideDisconnect',
+  TxStartPoint = 'TxStartPoint',
+  TxStopPoint = 'TxStopPoint',
+  StopTxOnInvalidId = 'StopTxOnInvalidId',
+  TxEndedMeasurands = 'TxEndedMeasurands',
+  TxStartedMeasurands = 'TxStartedMeasurands',
+  TxUpdatedMeasurands = 'TxUpdatedMeasurands',
+  TxUpdatedInterval = 'TxUpdatedInterval',
+}
+
+export enum OCPP20OptionalVariableName {
+  HeartbeatInterval = 'HeartbeatInterval',
+  WebSocketPingInterval = 'WebSocketPingInterval',
+}
+
+export enum OCPP20VendorVariableName {
+  ConnectionUrl = 'ConnectionUrl',
+}
index c094aab3e761dfaf7cc152c9a267c424a70aa8f3..9aeb91dc79d942f36df1e83a71574ab92cf33adb 100644 (file)
@@ -3,15 +3,23 @@ import {
   OCPP16SupportedFeatureProfiles,
   OCPP16VendorDefaultParametersKey,
 } from './1.6/Configuration';
+import {
+  OCPP20OptionalVariableName,
+  OCPP20RequiredVariableName,
+  OCPP20VendorVariableName,
+} from './2.0/Variables';
 import type { JsonObject } from '../JsonType';
 
 export const StandardParametersKey = {
   ...OCPP16StandardParametersKey,
+  ...OCPP20RequiredVariableName,
+  ...OCPP20OptionalVariableName,
 } as const;
 export type StandardParametersKey = OCPP16StandardParametersKey;
 
 export const VendorDefaultParametersKey = {
   ...OCPP16VendorDefaultParametersKey,
+  ...OCPP20VendorVariableName,
 } as const;
 export type VendorDefaultParametersKey = OCPP16VendorDefaultParametersKey;