public static createSerialNumber(
stationTemplate: ChargingStationTemplate,
- stationInfo: ChargingStationInfo = {} as ChargingStationInfo,
+ stationInfo: ChargingStationInfo,
params: {
randomSerialNumberUpperCase?: boolean;
randomSerialNumber?: boolean;
public static propagateSerialNumber(
stationTemplate: ChargingStationTemplate,
stationInfoSrc: ChargingStationInfo,
- stationInfoDst: ChargingStationInfo = {} as ChargingStationInfo
+ stationInfoDst: ChargingStationInfo
) {
if (!stationInfoSrc || !stationTemplate) {
throw new BaseError(
import Constants from '../../../utils/Constants';
import Utils from '../../../utils/Utils';
import type ChargingStation from '../../ChargingStation';
+import OCPPConstants from '../OCPPConstants';
import OCPPRequestService from '../OCPPRequestService';
import type OCPPResponseService from '../OCPPResponseService';
status: commandParams?.status,
} as unknown as Request;
case OCPP16RequestCommand.HEARTBEAT:
- return {} as unknown as Request;
+ return OCPPConstants.OCPP_REQUEST_EMPTY as unknown as Request;
case OCPP16RequestCommand.METER_VALUES:
return {
connectorId: commandParams?.connectorId,
import type { RequestParams } from '../../../types/ocpp/Requests';
import Utils from '../../../utils/Utils';
import type ChargingStation from '../../ChargingStation';
+import OCPPConstants from '../OCPPConstants';
import OCPPRequestService from '../OCPPRequestService';
import type OCPPResponseService from '../OCPPResponseService';
},
} as unknown as Request;
case OCPP20RequestCommand.HEARTBEAT:
- return {} as unknown as Request;
+ return OCPPConstants.OCPP_RESPONSE_EMPTY as unknown as Request;
case OCPP20RequestCommand.STATUS_NOTIFICATION:
return {
timestamp: commandParams?.timestamp ?? new Date(),
} from '../../types/ocpp/Responses';
export default class OCPPConstants {
+ static readonly OCPP_REQUEST_EMPTY = Object.freeze({});
static readonly OCPP_RESPONSE_EMPTY = Object.freeze({});
static readonly OCPP_RESPONSE_ACCEPTED = Object.freeze({ status: GenericStatus.ACCEPTED });
static readonly OCPP_RESPONSE_REJECTED = Object.freeze({ status: GenericStatus.REJECTED });