Request:
`ProcedureName`: 'startTransaction'
`PDU`: {
-`hashId`: the unique identifier of a charging station
-`connectorId`: the id of the connector
-`idTag`: the RFID tag
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,
+`connectorId`: connector id integer,
+`idTag`: RFID tag string
}
Response:
Request:
`ProcedureName`: 'stopTransaction'
`PDU`: {
-`hashId`: the unique identifier of a charging station
-`transactionId`: the id of the transaction
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,
+`transactionId`: transaction id integer
}
Response:
Request:
`ProcedureName`: 'startChargingStation'
`PDU`: {
-`hashId`: the unique identifier of a charging station
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
}
Response:
Request:
`ProcedureName`: 'stopChargingStation'
`PDU`: {
-`hashId`: the unique identifier of a charging station
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
}
Response:
Request:
`ProcedureName`: 'openConnection'
`PDU`: {
-`hashId`: the unique identifier of a charging station
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
}
Response:
Request:
`ProcedureName`: 'closeConnection'
`PDU`: {
-`hashId`: the unique identifier of a charging station
+`hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
}
Response:
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;
CLOSE_CONNECTION = 'closeConnection',
}
-export interface BroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId'> {
- hashId: string;
+interface BaseBroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId' | 'hashIds'> {
connectorId?: number;
transactionId?: number;
idTag?: string;
}
+interface HashIdBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
+ hashId: string;
+}
+
+interface HashIdsBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
+ hashIds: string[];
+}
+
+export type BroadcastChannelRequestPayload =
+ | HashIdBroadcastChannelRequestPayload
+ | HashIdsBroadcastChannelRequestPayload;
+
export type BroadcastChannelResponsePayload = ResponsePayload;
export type MessageEvent = { data: BroadcastChannelRequest | BroadcastChannelResponse };