Tachograph

State

Drivers working states

Declaration

getDriversWorkingStates()

Example

val state:Tachograph.State
assertTrue(state.driversWorkingStates[0].value?.driverNumber == 1)
assertTrue(state.driversWorkingStates[0].value?.workingState == DriverWorkingState.WorkingState.WORKING)
// Driver nr 1 is working

Drivers time states

Declaration

getDriversTimeStates()

Example

val state:Tachograph.State
assertTrue(state.driversTimeStates[0].value?.driverNumber == 3)
assertTrue(state.driversTimeStates[0].value?.timeState == DriverTimeState.TimeState.FOUR_REACHED)
// Driver nr 3 has reached 4 hours

Drivers cards present

Declaration

getDriversCardsPresent()

Example

val state:Tachograph.State
assertTrue(state.driversCardsPresent[0].value?.driverNumber == 6)
assertTrue(state.driversCardsPresent[0].value?.cardPresent == DriverCardPresent.CardPresent.PRESENT)
// Driver nr 6 has a card present

Vehicle motion

Declaration

getVehicleMotion()

Example

val state:Tachograph.State
assertTrue(state.vehicleMotion.value == Detected.DETECTED)
// Detected vehicle in motion

Vehicle overspeed

Declaration

getVehicleOverspeed()

Example

val state:Tachograph.State
assertTrue(state.vehicleOverspeed.value == Tachograph.VehicleOverspeed.NO_OVERSPEED)
// Vehicle is not overspeeding

Vehicle direction

Declaration

getVehicleDirection()

Example

val state:Tachograph.State
assertTrue(state.vehicleDirection.value == Tachograph.VehicleDirection.FORWARD)
// Vehicle is moving forward

Vehicle speed

Declaration

getVehicleSpeed()

Discussion

The tachograph vehicle speed

Example

val state:Tachograph.State
assertTrue(state.vehicleSpeed.value?.value == 80.0)
assertTrue(state.vehicleSpeed.value?.unit == Speed.Unit.KILOMETERS_PER_HOUR)
// Vehicle speed is 80.0km/h

Getters

Get Tachograph property availability information

Declaration

public GetStateAvailability()
public GetStateAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetStateAvailability()
// get driverWorkingState and driversTimeState property availabilities
val getAvailabilityProperties = GetStateAvailability(0x01, 0x02)

Get Tachograph properties

Declaration

public GetState()
public GetState(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetState()
// get driverWorkingState and driversTimeState properties
val getStateProperties = GetState(0x01, 0x02)