Add initial support for OCPP 1.6 firmware update simulation
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16ResponseService.ts
index e29957be3fdacebd525abc872cf9f5a466c22cee..ac183aecc4e9898d82c3e0c2defa2d775095859a 100644 (file)
@@ -25,11 +25,12 @@ import type {
   ChangeAvailabilityResponse,
   ChangeConfigurationResponse,
   ClearChargingProfileResponse,
-  DiagnosticsStatusNotificationResponse,
   GetConfigurationResponse,
   GetDiagnosticsResponse,
   OCPP16BootNotificationResponse,
   OCPP16DataTransferResponse,
+  OCPP16DiagnosticsStatusNotificationResponse,
+  OCPP16FirmwareStatusNotificationResponse,
   OCPP16HeartbeatResponse,
   OCPP16StatusNotificationResponse,
   OCPP16TriggerMessageResponse,
@@ -87,6 +88,7 @@ export default class OCPP16ResponseService extends OCPPResponseService {
       [OCPP16RequestCommand.METER_VALUES, this.emptyResponseHandler.bind(this)],
       [OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, this.emptyResponseHandler.bind(this)],
       [OCPP16RequestCommand.DATA_TRANSFER, this.emptyResponseHandler.bind(this)],
+      [OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION, this.emptyResponseHandler.bind(this)],
     ]);
     this.jsonSchemas = new Map<OCPP16RequestCommand, JSONSchemaType<JsonObject>>([
       [
@@ -183,7 +185,7 @@ export default class OCPP16ResponseService extends OCPPResponseService {
             ),
             'utf8'
           )
-        ) as JSONSchemaType<DiagnosticsStatusNotificationResponse>,
+        ) as JSONSchemaType<OCPP16DiagnosticsStatusNotificationResponse>,
       ],
       [
         OCPP16RequestCommand.DATA_TRANSFER,
@@ -197,6 +199,18 @@ export default class OCPP16ResponseService extends OCPPResponseService {
           )
         ) as JSONSchemaType<OCPP16DataTransferResponse>,
       ],
+      [
+        OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION,
+        JSON.parse(
+          fs.readFileSync(
+            path.resolve(
+              path.dirname(fileURLToPath(import.meta.url)),
+              '../../../assets/json-schemas/ocpp/1.6/FirmwareStatusNotificationResponse.json'
+            ),
+            'utf8'
+          )
+        ) as JSONSchemaType<OCPP16FirmwareStatusNotificationResponse>,
+      ],
     ]);
     this.jsonIncomingRequestResponseSchemas = new Map([
       [