EvChargingMediatorService

Service responsible for providing access to e-Mobility Service Providers (eMSPs) in the system. One or more eMSPs may be available and can be used to charge the vehicle. There can be only a single eMSP authenticated at the same time.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class CurrentChargingProgressInfo(val currentBatteryChargeLevel: Energy, @FloatRange(from = 0.0, to = 100.0) val currentBatteryChargePercentage: Float?, val maximumBatteryChargeLevel: Energy, val remainingRange: Distance, @FloatRange(from = 0.0, to = 100.0) val targetBatteryChargePercentage: Float?) : Parcelable

A data class that represents information on current battery charge level and remaining range.

Link copied to clipboard

Properties

Link copied to clipboard

Provides charging progress information including the current battery charge level and the current vehicle range. null if the vehicle is not currently charging.

Link copied to clipboard

This will contain the details of the charging station requested by calling retrieveChargingStationDetails. When a session is started externally (e.g. through an app) this field will be updated with the ChargingStation from the active session of the authenticated eMSP.

Link copied to clipboard

The authentication status of each eMSP known to the system.

Link copied to clipboard

The properties of each eMSP known to the system.

Link copied to clipboard

Indicates if the charging cable is plugged into the vehicle.

Link copied to clipboard

The configuration mode indicates when a UI is currently visible which allows a user to start and stop charging and have an overview of the charging progress, tariffs and other EV charging related information. The mode is intended to be enabled by multiple clients. The isConfigurationModeEnabled flag can be observed by a client in order to show a UI related to EV charging configuration when it is set to true and to stop showing the UI when the flag is set to false.

Link copied to clipboard
abstract val sessionInfo: SessionInfo?

Session information: session status, charging station id, charging point, and receipt of the charging session. This information will be updated during a session once more information is available.

Functions

Link copied to clipboard
abstract suspend fun clearChargingStationDetails()

Clear the currentChargingStation details. This will set currentChargingStation to null.

Link copied to clipboard
abstract suspend fun disableConfigurationMode()

Disables configuration mode by setting the isConfigurationModeEnabled to false.

Link copied to clipboard
abstract suspend fun enableConfigurationMode()

Enables configuration mode by setting the isConfigurationModeEnabled to true.

Link copied to clipboard
abstract suspend fun finishCharging(): EvChargingResult

Concludes the charging session. This function ends the current charging session and resets the internal states. Should be called when a charging session has completed or there has been a failure.

Link copied to clipboard
abstract suspend fun getApproximatedChargingTime(chargingPointConnector: Connector): Duration?

Evaluates the approximated time Duration at the charging stop, allowing for some additional time needed to use the charging facility or null if one of function parameter requirements was not satisfied.

Link copied to clipboard
abstract suspend fun getEstimatedChargingCost(chargingPointConnector: Connector, desiredChargePercentage: Float): Cost?

Provides the estimated Cost of charging at the chargingPointConnector based on the provided desiredChargePercentage. Returns null when chargingPointConnector contains non-valid data.

Link copied to clipboard
abstract suspend fun logIn(serviceIdentifier: EmspIdentifier): EvChargingResult

Request to start the authentication process for the specified eMSP. serviceIdentifiers are the keys returned by EvChargingMediatorService.emspInfo. The exact flow of events that form the authentication process is dependent upon the eMSP integration.

Link copied to clipboard
abstract suspend fun logOut(serviceIdentifier: EmspIdentifier): EvChargingResult

Request to log out of the eMSP service. The actual handling of this request should be implemented in the eMSP service plugin. See also EvChargingService.

Link copied to clipboard
abstract suspend fun postFailure(reason: FailureReason)

Post a failure to the listeners of EvChargingEventListener. This should be called when a failure has happened during the charging process, and the failure is not handled by the callee.

Link copied to clipboard

Clients should call this API to inform the platform of the result of the authentication process initiated by logIn if the authentication process was Open ID.

Link copied to clipboard
abstract suspend fun requestPrepareChargingSession()

Request to prepare the charging session. This method can be used by non-user interface components to request the user interface to show panels before actually charging.

Link copied to clipboard
abstract suspend fun retrieveChargingStationDetails(chargingStationId: ChargingStationId): EvChargingResult

This function will retrieve detailed information about the charging station. This information contains e.g. the charging points with its connectors and the tariffs and restrictions of the charging station. The resulting detailed information is stored in currentChargingStation.

Link copied to clipboard
abstract suspend fun setTargetBatteryCharge(minimalTargetBatteryChargePercentage: Float)

Set the target percentage to which the battery should be charged during the current charging session. This target is not enforced by the EvChargingMediatorService.

Link copied to clipboard
abstract suspend fun showCurrentChargingProgress()

Request the current charging progress information to be shown to the user. This method can be used by non-user interface components to request the user interface to show the current charging progress.

Link copied to clipboard
abstract suspend fun startCharging(chargingStationId: ChargingStationId, chargingPointId: ChargingPointId, connectorId: ConnectorId): EvChargingResult

Initiate a charging session. The state of the current charging session can be monitored on sessionInfo.

Link copied to clipboard
abstract suspend fun stopCharging(): EvChargingResult

Called when the user has interacted with the UI to stop an active charging session.