Cruise control
State
Cruise control
Declaration
getCruiseControl()
Example
val state:CruiseControl.State
assertTrue(state.cruiseControl.value == ActiveState.ACTIVE)
// Cruise control is active
Limiter
Declaration
getLimiter()
Example
val state:CruiseControl.State
assertTrue(state.limiter.value == CruiseControl.Limiter.HIGHER_SPEED_REQUESTED)
// Higher speed requested by the limiter
Target speed
Declaration
getTargetSpeed()
Discussion
The target speed
Example
val state:CruiseControl.State
assertTrue(state.targetSpeed.value?.value == 61.0)
assertTrue(state.targetSpeed.value?.unit == Speed.Unit.KILOMETERS_PER_HOUR)
// The target speed is set to 61.0km/h
Adaptive cruise control
Declaration
getAdaptiveCruiseControl()
Example
val state:CruiseControl.State
assertTrue(state.adaptiveCruiseControl.value == ActiveState.INACTIVE)
// Adaptive Cruise Control is inactive
Acc target speed
Declaration
getAccTargetSpeed()
Discussion
The target speed of the Adaptive Cruise Control
Example
val state:CruiseControl.State
assertTrue(state.accTargetSpeed.value?.value == 67.0)
assertTrue(state.accTargetSpeed.value?.unit == Speed.Unit.KILOMETERS_PER_HOUR)
// The Adaptive Cruise Control target speed is set to 67.0km/h
Setters
Activate deactivate cruise control
Declaration
public ActivateDeactivateCruiseControl(ActiveState cruiseControl, @Nullable Speed targetSpeed)
Example
val activateDeactivateCruiseControl = CruiseControl.ActivateDeactivateCruiseControl(ActiveState.ACTIVE, Speed(61.0, Speed.Unit.KILOMETERS_PER_HOUR))
Getters
Get Cruise Control property availability information
Declaration
public GetStateAvailability()
public GetStateAvailability(byte... propertyIdentifiers)
Example
// get all property availabilities
val getAvailability = GetStateAvailability()
// get cruiseControl and limiter property availabilities
val getAvailabilityProperties = GetStateAvailability(0x01, 0x02)
Get Cruise Control properties
Declaration
public GetState()
public GetState(byte... propertyIdentifiers)
Example
// get all properties
val getState = GetState()
// get cruiseControl and limiter properties
val getStateProperties = GetState(0x01, 0x02)