-import {
- type ChargingStation,
- ChargingStationConfigurationUtils,
- WorkerBroadcastChannel,
-} from './internal';
+import type { ChargingStation } from './ChargingStation';
+import { ChargingStationConfigurationUtils } from './ChargingStationConfigurationUtils';
import { OCPP16ServiceUtils } from './ocpp';
+import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
import { BaseError, type OCPPError } from '../exception';
import {
AuthorizationStatus,
}
const [uuid, command, requestPayload] = validatedMessageEvent.data as BroadcastChannelRequest;
if (
- requestPayload?.hashIds !== undefined &&
+ !Utils.isNullOrUndefined(requestPayload?.hashIds) &&
requestPayload?.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false
) {
return;
}
- if (requestPayload?.hashId !== undefined) {
+ if (!Utils.isNullOrUndefined(requestPayload?.hashId)) {
logger.error(
`${this.chargingStation.logPrefix()} ${moduleName}.requestHandler: 'hashId' field usage in PDU is deprecated, use 'hashIds' array instead`
);
try {
commandResponse = await this.commandHandler(command, requestPayload);
if (
- commandResponse === undefined ||
- commandResponse === null ||
+ Utils.isNullOrUndefined(commandResponse) ||
Utils.isEmptyObject(commandResponse as CommandResponse)
) {
responsePayload = {