// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
-import crypto from 'crypto';
import fs from 'fs';
+import crypto from 'node:crypto';
import path from 'path';
import { URL } from 'url';
import { parentPort } from 'worker_threads';
type IncomingRequest,
IncomingRequestCommand,
type MeterValuesRequest,
+ type OutgoingRequest,
RequestCommand,
type ResponseCallback,
type StatusNotificationRequest,
this.messageBuffer.forEach((message) => {
// TODO: evaluate the need to track performance
this.wsConnection.send(message);
+ const [messageType] = JSON.parse(message) as OutgoingRequest | Response | ErrorResponse;
+ logger.debug(
+ `${this.logPrefix()} >> Buffered ${OCPPServiceUtils.getMessageTypeString(
+ messageType
+ )} payload sent: ${message}`
+ );
this.messageBuffer.delete(message);
});
}