Search in sources :

Example 1 with UpdateChargeboxParams

use of de.rwth.idsg.steve.repository.dto.UpdateChargeboxParams in project steve by RWTH-i5-IDSG.

the class CentralSystemService16_Service method bootNotification.

public BootNotificationResponse bootNotification(BootNotificationRequest parameters, String chargeBoxIdentity, OcppProtocol ocppProtocol) {
    DateTime now = DateTime.now();
    UpdateChargeboxParams params = UpdateChargeboxParams.builder().ocppProtocol(ocppProtocol).vendor(parameters.getChargePointVendor()).model(parameters.getChargePointModel()).pointSerial(parameters.getChargePointSerialNumber()).boxSerial(parameters.getChargeBoxSerialNumber()).fwVersion(parameters.getFirmwareVersion()).iccid(parameters.getIccid()).imsi(parameters.getImsi()).meterType(parameters.getMeterType()).meterSerial(parameters.getMeterSerialNumber()).chargeBoxId(chargeBoxIdentity).heartbeatTimestamp(now).build();
    boolean isRegistered = ocppServerRepository.updateChargebox(params);
    notificationService.ocppStationBooted(chargeBoxIdentity, isRegistered);
    RegistrationStatus status;
    if (isRegistered) {
        status = RegistrationStatus.ACCEPTED;
    } else {
        status = RegistrationStatus.REJECTED;
        chargePointHelperService.rememberNewUnknown(chargeBoxIdentity);
    }
    return new BootNotificationResponse().withStatus(status).withCurrentTime(now).withInterval(settingsRepository.getHeartbeatIntervalInSeconds());
}
Also used : BootNotificationResponse(ocpp.cs._2015._10.BootNotificationResponse) UpdateChargeboxParams(de.rwth.idsg.steve.repository.dto.UpdateChargeboxParams) RegistrationStatus(ocpp.cs._2015._10.RegistrationStatus) DateTime(org.joda.time.DateTime)

Aggregations

UpdateChargeboxParams (de.rwth.idsg.steve.repository.dto.UpdateChargeboxParams)1 BootNotificationResponse (ocpp.cs._2015._10.BootNotificationResponse)1 RegistrationStatus (ocpp.cs._2015._10.RegistrationStatus)1 DateTime (org.joda.time.DateTime)1