info.bytes / 1024
} bytes transferred from diagnostics archive ${info.name}`
);
- await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
- OCPP16DiagnosticsStatus.Uploading
+ await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+ {
+ status: OCPP16DiagnosticsStatus.Uploading,
+ }
);
});
uploadResponse = await ftpClient.uploadFrom(
uri.pathname + diagnosticsArchive
);
if (uploadResponse.code === 226) {
- await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
- OCPP16DiagnosticsStatus.Uploaded
+ await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+ {
+ status: OCPP16DiagnosticsStatus.Uploaded,
+ }
);
if (ftpClient) {
ftpClient.close();
OCPP16IncomingRequestCommand.GET_DIAGNOSTICS
);
} catch (error) {
- await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
- OCPP16DiagnosticsStatus.UploadFailed
+ await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+ {
+ status: OCPP16DiagnosticsStatus.UploadFailed,
+ }
);
if (ftpClient) {
ftpClient.close();
uri.protocol
} to transfer the diagnostic logs archive`
);
- await this.chargingStation.ocppRequestService.sendDiagnosticsStatusNotification(
- OCPP16DiagnosticsStatus.UploadFailed
+ await this.chargingStation.ocppRequestService.sendMessageHandler(
+ OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
+ {
+ status: OCPP16DiagnosticsStatus.UploadFailed,
+ }
);
return Constants.OCPP_RESPONSE_EMPTY;
}
OCPP16RequestCommand,
StatusNotificationRequest,
} from '../../../types/ocpp/1.6/Requests';
-import { MeterValuesRequest, OCPP16MeterValue } from '../../../types/ocpp/1.6/MeterValues';
import { ResponseType, SendParams } from '../../../types/ocpp/Requests';
import type ChargingStation from '../../ChargingStation';
import Constants from '../../../utils/Constants';
import { ErrorType } from '../../../types/ocpp/ErrorType';
import { JsonType } from '../../../types/JsonType';
+import { MeterValuesRequest } from '../../../types/ocpp/1.6/MeterValues';
import { OCPP16DiagnosticsStatus } from '../../../types/ocpp/1.6/DiagnosticsStatus';
import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
import OCPPError from '../../../exception/OCPPError';
);
}
- public async sendDiagnosticsStatusNotification(
- diagnosticsStatus: OCPP16DiagnosticsStatus
- ): Promise<void> {
- const payload: DiagnosticsStatusNotificationRequest = {
- status: diagnosticsStatus,
- };
- await this.sendMessage(
- Utils.generateUUID(),
- payload,
- OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION
- );
- }
-
private buildCommandPayload(
commandName: OCPP16RequestCommand,
commandParams?: JsonType
import { HandleErrorParams } from '../../types/Error';
import { JsonType } from '../../types/JsonType';
import { MessageType } from '../../types/ocpp/MessageType';
-import { MeterValue } from '../../types/ocpp/MeterValues';
import OCPPError from '../../exception/OCPPError';
import type OCPPResponseService from './OCPPResponseService';
import PerformanceStatistics from '../../performance/PerformanceStatistics';
commandParams?: JsonType,
params?: SendParams
): Promise<ResponseType>;
-
- public abstract sendDiagnosticsStatusNotification(
- diagnosticsStatus: DiagnosticsStatus
- ): Promise<void>;
}