firmware validate
ADD
src/assets/server/ocpp/schemas/firmware-status-notification.json
+{
+ "$id": "firmware-status-notification-request",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "FirmwareStatusNotificationRequest",
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "Downloaded",
+ "DownloadFailed",
+ "Downloading",
+ "Idle",
+ "InstallationFailed",
+ "Installing",
+ "Installed"
+ ]
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "status"
+ ]
+}

MODIFY
src/server/ocpp/validation/OCPPValidation.ts
src/server/ocpp/validation/OCPPValidation.ts
@@ -25,6 +25,8 @@ export default class OCPPValidation extends SchemaValidator {
private stopTransactionRequest15: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/ocpp/schemas/stop-transaction-request-15.json`, 'utf8'));
private diagnosticsStatusNotificationRequest: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/ocpp/schemas/diagnostics-status-notification-request.json`, 'utf8'));
private heartbeatRequest: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/ocpp/schemas/heartbeat-request.json`, 'utf8'));
+ private firmwareStatusNotificationRequest: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/ocpp/schemas/firware-status-notification-request.json`, 'utf8'));
+
private constructor() {
super('OCPPValidation');
}
@@ -72,6 +74,7 @@ export default class OCPPValidation extends SchemaValidator {
public validateFirmwareStatusNotification(chargingStation: ChargingStation,
firmwareStatusNotification: OCPPFirmwareStatusNotificationRequestExtended): void {
+ this.validate(this.firmwareStatusNotificationRequest, firmwareStatusNotification);
}
public validateStartTransaction(chargingStation: ChargingStation, startTransaction: OCPPStartTransactionRequestExtended): void {

firmware validate