type ChangeAvailabilityResponse,
type ChangeConfigurationRequest,
type ChangeConfigurationResponse,
- ChargingProfilePurposeType,
type ClearChargingProfileRequest,
type ClearChargingProfileResponse,
ErrorType,
OCPP16ChargePointErrorCode,
OCPP16ChargePointStatus,
type OCPP16ChargingProfile,
+ OCPP16ChargingProfilePurposeType,
type OCPP16ClearCacheRequest,
type OCPP16DataTransferRequest,
type OCPP16DataTransferResponse,
) => Promise<void>,
chargingStation,
`${commandPayload.type}Reset` as OCPP16StopTransactionReason
- ).catch(() => {
- /* This is intentional */
- });
+ ).catch(Constants.EMPTY_FUNCTION);
logger.info(
`${chargingStation.logPrefix()} ${
commandPayload.type
OCPP16StatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId,
- status: OCPP16ChargePointStatus.AVAILABLE,
+ status: OCPP16ChargePointStatus.Available,
errorCode: OCPP16ChargePointErrorCode.NO_ERROR,
});
- chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.AVAILABLE;
+ chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.Available;
return OCPPConstants.OCPP_RESPONSE_UNLOCKED;
}
}
if (
commandPayload.csChargingProfiles.chargingProfilePurpose ===
- ChargingProfilePurposeType.CHARGE_POINT_MAX_PROFILE &&
+ OCPP16ChargingProfilePurposeType.CHARGE_POINT_MAX_PROFILE &&
commandPayload.connectorId !== 0
) {
return OCPPConstants.OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED;
}
if (
commandPayload.csChargingProfiles.chargingProfilePurpose ===
- ChargingProfilePurposeType.TX_PROFILE &&
+ OCPP16ChargingProfilePurposeType.TX_PROFILE &&
(commandPayload.connectorId === 0 ||
chargingStation.getConnectorStatus(commandPayload.connectorId)?.transactionStarted ===
false)
}
const chargePointStatus: OCPP16ChargePointStatus =
commandPayload.type === OCPP16AvailabilityType.OPERATIVE
- ? OCPP16ChargePointStatus.AVAILABLE
- : OCPP16ChargePointStatus.UNAVAILABLE;
+ ? OCPP16ChargePointStatus.Available
+ : OCPP16ChargePointStatus.Unavailable;
if (connectorId === 0) {
let response: ChangeAvailabilityResponse = OCPPConstants.OCPP_AVAILABILITY_RESPONSE_ACCEPTED;
for (const id of chargingStation.connectors.keys()) {
OCPP16StatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId: transactionConnectorId,
- status: OCPP16ChargePointStatus.PREPARING,
+ status: OCPP16ChargePointStatus.Preparing,
errorCode: OCPP16ChargePointErrorCode.NO_ERROR,
});
const connectorStatus = chargingStation.getConnectorStatus(transactionConnectorId);
- connectorStatus.status = OCPP16ChargePointStatus.PREPARING;
+ connectorStatus.status = OCPP16ChargePointStatus.Preparing;
if (chargingStation.isChargingStationAvailable() === true) {
// Check if authorized
if (chargingStation.getAuthorizeRemoteTxRequests() === true) {
idTag: string
): Promise<GenericResponse> {
if (
- chargingStation.getConnectorStatus(connectorId)?.status !== OCPP16ChargePointStatus.AVAILABLE
+ chargingStation.getConnectorStatus(connectorId)?.status !== OCPP16ChargePointStatus.Available
) {
await chargingStation.ocppRequestService.requestHandler<
OCPP16StatusNotificationRequest,
OCPP16StatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId,
- status: OCPP16ChargePointStatus.AVAILABLE,
+ status: OCPP16ChargePointStatus.Available,
errorCode: OCPP16ChargePointErrorCode.NO_ERROR,
});
- chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.AVAILABLE;
+ chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.Available;
}
logger.warn(
`${chargingStation.logPrefix()} Remote starting transaction REJECTED on connector Id ${connectorId.toString()}, idTag '${idTag}', availability '${
connectorId: number,
cp: OCPP16ChargingProfile
): boolean {
- if (cp && cp.chargingProfilePurpose === ChargingProfilePurposeType.TX_PROFILE) {
+ if (cp && cp.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE) {
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, cp);
logger.debug(
`${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on connector id ${connectorId}: %j`,
cp
);
return true;
- } else if (cp && cp.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE) {
+ } else if (cp && cp.chargingProfilePurpose !== OCPP16ChargingProfilePurposeType.TX_PROFILE) {
logger.warn(
`${chargingStation.logPrefix()} Not allowed to set ${
cp.chargingProfilePurpose
OCPP16StatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId,
- status: OCPP16ChargePointStatus.FINISHING,
+ status: OCPP16ChargePointStatus.Finishing,
errorCode: OCPP16ChargePointErrorCode.NO_ERROR,
});
- chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.FINISHING;
+ chargingStation.getConnectorStatus(connectorId).status = OCPP16ChargePointStatus.Finishing;
const stopResponse = await chargingStation.stopTransactionOnConnector(
connectorId,
OCPP16StopTransactionReason.REMOTE
) => Promise<void>,
this,
chargingStation
- ).catch(() => {
- /* This is intentional */
- });
+ ).catch(Constants.EMPTY_FUNCTION);
} else {
setTimeout(() => {
- this.updateFirmware(chargingStation).catch(() => {
- /* Intentional */
- });
+ this.updateFirmware(chargingStation).catch(Constants.EMPTY_FUNCTION);
}, retrieveDate?.getTime() - now);
}
return OCPPConstants.OCPP_RESPONSE_EMPTY;
OCPP16StatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.STATUS_NOTIFICATION, {
connectorId,
- status: OCPP16ChargePointStatus.UNAVAILABLE,
+ status: OCPP16ChargePointStatus.Unavailable,
errorCode: OCPP16ChargePointErrorCode.NO_ERROR,
});
chargingStation.getConnectorStatus(connectorId).status =
- OCPP16ChargePointStatus.UNAVAILABLE;
+ OCPP16ChargePointStatus.Unavailable;
}
}
if (
.then((response) => {
chargingStation.bootNotificationResponse = response;
})
- .catch(() => {
- /* This is intentional */
- });
+ .catch(Constants.EMPTY_FUNCTION);
}, Constants.OCPP_TRIGGER_MESSAGE_DELAY);
return OCPPConstants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED;
case OCPP16MessageTrigger.Heartbeat:
triggerMessage: true,
}
)
- .catch(() => {
- /* This is intentional */
- });
+ .catch(Constants.EMPTY_FUNCTION);
}, Constants.OCPP_TRIGGER_MESSAGE_DELAY);
return OCPPConstants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED;
case OCPP16MessageTrigger.StatusNotification:
triggerMessage: true,
}
)
- .catch(() => {
- /* This is intentional */
- });
+ .catch(Constants.EMPTY_FUNCTION);
} else {
for (const connectorId of chargingStation.connectors.keys()) {
chargingStation.ocppRequestService
triggerMessage: true,
}
)
- .catch(() => {
- /* This is intentional */
- });
+ .catch(Constants.EMPTY_FUNCTION);
}
}
}, Constants.OCPP_TRIGGER_MESSAGE_DELAY);