X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorkerBroadcastChannel.ts;h=9de2cfb2784dc75965403734ccb97b327d940bed;hb=4eca248cf2d300b51dc45412766a821184a00dcb;hp=9e88b4189372eaa030de37cfe159e4cdb3a89044;hpb=86102a27a41ff89422d375ff847c23b293e5773a;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 9e88b418..9de2cfb2 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -44,9 +44,23 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca const [uuid, command, requestPayload] = messageEvent.data as BroadcastChannelRequest; - if (requestPayload?.hashId !== this.chargingStation.hashId) { + if ( + requestPayload?.hashId === undefined && + (requestPayload?.hashIds as string[])?.includes(this.chargingStation.hashId) === false + ) { return; } + if ( + requestPayload?.hashIds === undefined && + requestPayload?.hashId !== this.chargingStation.hashId + ) { + return; + } + if (requestPayload?.hashId !== undefined) { + logger.warn( + `${this.chargingStation.logPrefix()} ${moduleName}.requestHandler: 'hashId' field usage in PDU is deprecated, use 'hashIds' instead` + ); + } let responsePayload: BroadcastChannelResponsePayload; let commandResponse: CommandResponse;