Windows

State

Open percentages

Declaration

getOpenPercentages()

Example

val state:Windows.State
assertTrue(state.openPercentages[0].value?.location == WindowLocation.FRONT_LEFT)
assertTrue(state.openPercentages[0].value?.openPercentage == 0.2)
// Front left window is 20% open

Positions

Declaration

getPositions()

Example

val state:Windows.State
assertTrue(state.positions[0].value?.location == WindowLocation.FRONT_LEFT)
assertTrue(state.positions[0].value?.position == WindowPosition.Position.OPEN)
// Front left window is open

Setters

Control windows

Declaration

public ControlWindows(@Nullable List<WindowOpenPercentage> openPercentages, @Nullable List<WindowPosition> positions)

Example

val controlWindows = Windows.ControlWindows(arrayListOf(
        WindowOpenPercentage(WindowLocation.FRONT_LEFT, 0.2), 
        WindowOpenPercentage(WindowLocation.FRONT_RIGHT, 0.5), 
        WindowOpenPercentage(WindowLocation.REAR_RIGHT, 0.5), 
        WindowOpenPercentage(WindowLocation.REAR_LEFT, 0.1), 
        WindowOpenPercentage(WindowLocation.HATCH, 0.18))
    , 
    arrayListOf(
        WindowPosition(WindowLocation.FRONT_LEFT, WindowPosition.Position.OPEN), 
        WindowPosition(WindowLocation.FRONT_RIGHT, WindowPosition.Position.OPEN), 
        WindowPosition(WindowLocation.REAR_RIGHT, WindowPosition.Position.CLOSED), 
        WindowPosition(WindowLocation.REAR_LEFT, WindowPosition.Position.OPEN), 
        WindowPosition(WindowLocation.HATCH, WindowPosition.Position.OPEN))
    )    

Getters

Get Windows property availability information

Declaration

public GetWindowsAvailability()
public GetWindowsAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetWindowsAvailability()
// get openPercentage and position property availabilities
val getAvailabilityProperties = GetWindowsAvailability(0x02, 0x03)

Get windows

Declaration

public GetWindows()
public GetWindows(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetWindows()
// get openPercentage and position properties
val getStateProperties = GetWindows(0x02, 0x03)