X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPRequestService.ts;h=4115eff1144f1c50a91e79f7197632f47fd6e553;hb=617cad0c86c3fea53b56a738bb0d6ddc3da05237;hp=4ef39b52ebec7e7e843a13b9b388bea1de8ec567;hpb=76a5d780d1eb17a18fd5f9d95df2cf0c8bc3d9c9;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 4ef39b52..4115eff1 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -1,8 +1,8 @@ import Ajv, { type JSONSchemaType } from 'ajv'; import ajvFormats from 'ajv-formats'; -import type { OCPPResponseService } from './OCPPResponseService'; -import { OCPPServiceUtils } from './OCPPServiceUtils'; +import { type OCPPResponseService, OCPPServiceUtils } from './internal'; +import type { ChargingStation } from '../../charging-station'; import { OCPPError } from '../../exception'; import { PerformanceStatistics } from '../../performance'; import { @@ -23,10 +23,7 @@ import { type ResponseCallback, type ResponseType, } from '../../types'; -import { Constants } from '../../utils/Constants'; -import { logger } from '../../utils/Logger'; -import { Utils } from '../../utils/Utils'; -import type { ChargingStation } from '../ChargingStation'; +import { Constants, Utils, logger } from '../../utils'; const moduleName = 'OCPPRequestService'; @@ -278,7 +275,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `WebSocket closed or errored for buffered message id '${messageId}' with content '${messageToSend}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ) ); } else if (wsClosedOrErrored) { @@ -286,7 +283,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `WebSocket closed or errored for non buffered message id '${messageId}' with content '${messageToSend}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ); // Reject response if (messageType !== MessageType.CALL_MESSAGE) { @@ -361,7 +358,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `Timeout for message id '${messageId}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ), () => { messageType === MessageType.CALL_MESSAGE && chargingStation.requests.delete(messageId);