Fixes to OCPP 1.6 payload type definitions
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 6 Jan 2023 21:43:40 +0000 (22:43 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 6 Jan 2023 21:43:40 +0000 (22:43 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/types/ocpp/1.6/MeterValues.ts
src/types/ocpp/1.6/Requests.ts
src/types/ocpp/1.6/Transaction.ts

index 089ecc76e065d4eb01d3ca36da3a71a571e7147c..15b914c39e36db78bb0c5915c850febe929e49b9 100644 (file)
@@ -58,7 +58,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
     debug = false
   ): OCPP16MeterValue {
     const meterValue: OCPP16MeterValue = {
-      timestamp: new Date().toISOString(),
+      timestamp: new Date(),
       sampledValue: [],
     };
     const connector = chargingStation.getConnectorStatus(connectorId);
@@ -686,7 +686,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
     meterStart: number
   ): OCPP16MeterValue {
     const meterValue: OCPP16MeterValue = {
-      timestamp: new Date().toISOString(),
+      timestamp: new Date(),
       sampledValue: [],
     };
     // Energy.Active.Import.Register measurand (default)
@@ -711,7 +711,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
     meterStop: number
   ): OCPP16MeterValue {
     const meterValue: OCPP16MeterValue = {
-      timestamp: new Date().toISOString(),
+      timestamp: new Date(),
       sampledValue: [],
     };
     // Energy.Active.Import.Register measurand (default)
index 79bad3626e7dfd650cde76c8cdc6a3af79dc04e8..0cfca50e1ee8aeb2ac0ce42654a83ffc3d1d64fc 100644 (file)
@@ -93,7 +93,7 @@ export interface OCPP16SampledValue extends JsonObject {
 }
 
 export interface OCPP16MeterValue extends JsonObject {
-  timestamp: string;
+  timestamp: Date;
   sampledValue: OCPP16SampledValue[];
 }
 
index 78fe4105fe2f533ea4d0b2c9991a3e4cf89de5e6..678eacc990e50012964a66611eac978ed0d8c55c 100644 (file)
@@ -55,7 +55,7 @@ export interface OCPP16StatusNotificationRequest extends JsonObject {
   errorCode: OCPP16ChargePointErrorCode;
   status: OCPP16ChargePointStatus;
   info?: string;
-  timestamp?: string;
+  timestamp?: Date;
   vendorId?: string;
   vendorErrorCode?: string;
 }
index 14f9223c3c0d98188ded3b54f0492e0c849726cf..a11de78ddd2943b82e6d6f832f7414bc7ce43a10 100644 (file)
@@ -42,7 +42,7 @@ export interface OCPP16StartTransactionRequest extends JsonObject {
   connectorId: number;
   idTag: string;
   meterStart: number;
-  timestamp: string;
+  timestamp: Date;
   reservationId?: number;
 }
 
@@ -54,7 +54,7 @@ export interface OCPP16StartTransactionResponse extends JsonObject {
 export interface OCPP16StopTransactionRequest extends JsonObject {
   idTag?: string;
   meterStop: number;
-  timestamp: string;
+  timestamp: Date;
   transactionId: number;
   reason?: OCPP16StopTransactionReason;
   transactionData?: OCPP16MeterValue[];