Webinos Logo

Vehicle API

Webinos API Specifications

15 Oct 2012

Authors


Abstract

The webinos vehicle API provides access to specific vehicle data.

The design is influenced from W3C's DOM Level 3 Events model and defines event types for retrieving information about the vehicle including trip computer data, gears or park sensors.Further more it exposes information about lights, doors, windows and seating setting. The geolocation, speed and acceleration can be retrieved using the geolocation and device orientation API. The gps navigation related functions (see draft version) have been moved the Navigation API.

Table of Contents

  1. Introduction
  2. Interfaces and Dictionaries
    1. VehicleData
    2. VehicleInterface
    3. Webinos
    4. ClimateControlData
    5. LightData
    6. ParkSensorsData
    7. TripComputerData
    8. GearData
    9. WiperData
    10. EngineOilData
    11. SeatSetting
    12. SeatData
    13. TirePressureData
    14. DoorData
    15. WindowData
  3. Callbacks
    1. VehicleErrorCallback
    2. VehicleDataHandler
  4. Enums
    1. Fuel
    2. Hybrid
    3. SteeringWheelPosition
    4. VehicleTransmission
    5. VehicleClimateZone
    6. VehicleLight
    7. ParkSensorPosition
    8. Gear
    9. WiperStatus
    10. EngineOilStatus
    11. SeatPosition
    12. SeatOption
    13. VehicleDataType
  5. Features
  6. Full WebIDL

Summary of Methods

Interface Method
VehicleData
VehicleInterface void get(VehicleDataType vehicleDataId, VehicleDataHandler handler, VehicleErrorCallback errorCB)
Webinos
ClimateControlData void initClimateControlData(boolean bubbles, boolean cancelable, DOMString zone, short desiredTemperature, boolean acStatus, short ventLevel, short ventMode)
LightData void initLightData(VehicleLight lightId, boolean active)
ParkSensorsData void initParkSensorsData(ParkSensorPosition position, short outLeft, short left, short midLeft, short midRight, short right, short outRight)
TripComputerData void initTripComputerData(float averageConsumption, float tripConsumption, float averageSpeed, float tripSpeed, float tripDistance, float mileage, float range)
GearData void initGearData(Gear gear)
WiperData void initWiperData(WiperStatus position)
EngineOilData void initEngineOilData(EngineOilLevel level)
SeatData void initSeatData(SeatPosition position, SeatSetting[] settings)
TirePressureData void initTirePressureData(Short frontLeft, Short frontRight, Short rearRight, Short rearLeft)
DoorData void initDoorData(boolean driver, boolean frontPassenger, boolean behindDriver, boolean behindPassenger, boolean trunkDeck)
WindowData void initWindowData(boolean driver, boolean frontPassenger, short behindDriver, short behindPassenger)

Introduction

The API exposes vehicle data, which is available on the infotainment vehicle bus (e.g. MOST). The infotainment bus is usually the access point for the headunit to receveive vehicle data (diagram on vehicle bus architecture). Some data from other busses (high/low speed CAN) are routed into the bus over the central gateway such as speed or gear.

Interfaces and Dictionaries

Interface VehicleData

Generic Vehicle Data The interface defines a generic data event for vehicle specific data. It is derived from Event.

WebIDL
        [NoInterfaceObject]
        interface VehicleData : Event{
        
        };

Interface VehicleInterface

The interface defines general information about the vehicle and is the object, where the event listener for vehicle related data can be registered. The interface is accessible through the webinos.vehicle object.

WebIDL
        [NoInterfaceObject]
        interface VehicleInterface : EventTarget {
                readonly attribute DOMString brand;
                readonly attribute DOMString model;
                readonly attribute DOMString year;
                readonly attribute Fuel fuel;
                readonly attribute Hybrid hybrid;
                readonly attribute SteeringWheelPosition steeringwheel;
                readonly attribute VehicleTransmission transmission;
                void get(VehicleDataType vehicleDataId, VehicleDataHandler handler, VehicleErrorCallback errorCB);
        };

Attributes

readonly DOMString brand

Attribute denotes brand name of the vehicle.

This attribute is readonly.
readonly DOMString model

Attribute reflects model name of the vehicle.

This attribute is readonly.
readonly DOMString year

Attribute denotes production year of the vehicle.

This attribute is readonly.
readonly Fuel fuel

Attribute reflects fuel type of the vehicle.

This attribute is readonly.
readonly Hybrid hybrid

Attribute reflects hybrid type of the vehicle

This attribute is readonly.
readonly SteeringWheelPosition steeringwheel

Attribute reflects steering wheel position

This attribute is readonly.
readonly VehicleTransmission transmission

Attribute denotes transmission type of the vehicle.

This attribute is readonly.

Methods

get

Method allows to request vehicle data in a non-recurring way and is independant from value changes (cf. events). The same identifiers are used for vehicle data as well as for the different vehicle events (ClimateControlEvent, ControlEvent, NavigationEvent, ParkSensorsEvent, ShiftEvent).

Signature
void get(VehicleDataType vehicleDataId, VehicleDataHandler handler, VehicleErrorCallback errorCB);
Code example
 webinos.vehicle.get("climate-all", dataHandler);
 function dataHandler(data){
        if(data.acStatus){
                console.log("Airconditioning is on");
                if(data.desiredTemperature < 19){
                        console.log("This is not so good for your health");
                                }
        }
 }
 
Parameters
  • vehicleDataId
    • Optional: No.
    • Nullable: No
    • Type: VehicleDataType
    • Description: Parameter specifies the type of data, which shall be retrieved. The identifiers for the different data types are defined in the different vehicle event interfaces (ClimateControlEvent, ControlEvent, NavigationEvent, ParkSensorsEvent, ShiftEvent, StatusDataEvent). The identifiers are defined as values of the various enums: ClimateZone, VehicleLight, DestinationEventType, ParkSensorPosition, VehicleStatusComponents.
  • handler
    • Optional: No.
    • Nullable: No
    • Type: VehicleDataHandler
    • Description: Parameter specifies the function to handle the result.
  • errorCB
    • Optional: No.
    • Nullable: No
    • Type: VehicleErrorCallback
    • Description: Parameter specifies the callback function in case of an error.

Interface Webinos (partial interface)

The Vehicle interface describes the part of the Vehicle API accessible through the webinos object.

WebIDL
        partial interface Webinos {
          readonly attribute VehicleInterface vehicle;
         };

Interface ClimateControlData

The interface defines a climate control event. The event provides information about changes to the climate control system inside the vehicle.

WebIDL
        [NoInterfaceObject]
        interface ClimateControlData : VehicleData{
                readonly attribute VehicleClimateZone zone;
                readonly attribute unsigned short desiredTemperature; 
                readonly attribute boolean acStatus;
                readonly attribute unsigned short ventLevel;
                readonly attribute boolean ventMode;
                void initClimateControlData(boolean bubbles, boolean cancelable, DOMString zone, short desiredTemperature, boolean acStatus, short ventLevel, short ventMode);
        };
Code example
 webinos.vehicle.addEventListener("climate", climateHandler, null);
 function climateHandler(data){
                console.log(data.zone + " desired temperature is " + data.desiredTemperature + "° C");                 
        }                               
 

Attributes

readonly VehicleClimateZone zone

Attribute defines the zone of the climate control event.

This attribute is readonly.
readonly unsigned short desiredTemperature

Attribute defines the desired temperature in degree celsius.

This attribute is readonly.
readonly boolean acStatus

Attribute defines, if the AC switched on or not.

This attribute is readonly.
readonly unsigned short ventLevel

Attribute defines the level of the vents. This value can be 1-9.

This attribute is readonly.
readonly boolean ventMode

Attribute defines if the vent is used in automatic mode or not.

This attribute is readonly.

Methods

initClimateControlData

Method is used to set initial values of a climate control event.

Signature
void initClimateControlData(boolean bubbles, boolean cancelable, DOMString zone, short desiredTemperature, boolean acStatus, short ventLevel, short ventMode);
Parameters
  • bubbles
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: True if event bubbles.
  • cancelable
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: True if event is cancelable.
  • zone
    • Optional: No.
    • Nullable: No
    • Type: DOMString
    • Description: zone where event climate settings have been changed.
  • desiredTemperature
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: desired temperature in degree celsius.
  • acStatus
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: true if the air conditioning is running.
  • ventLevel
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: level of the vent.
  • ventMode
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: true, if the vent is in automatic mode.

Interface LightData

The interface defines a light data. The event signals a change for a light unit inside the vehicle. The identifiers for the different light events are defined in the enum VehicleLight.

WebIDL
        interface LightData : VehicleData{
                readonly attribute VehicleLight lightId;
                readonly attribute boolean active;
                void initLightData(VehicleLight lightId, boolean active);
        };
Code example
        webinos.vehicle.addEventListener("light-hibeam", lightHandler, false);
      function lightHandler(cEvent){
                if(cEvent.controlId == "hibeam"){
                        if(cEvent.active == true){
                                console.log("Hibeam turned on");
                        }else{
                                console.log("Hibeam turned off");
                        }
                }
        }
 

Attributes

readonly VehicleLight lightId

Attribute describes the source of the event.

This attribute is readonly.
readonly boolean active

Attribute describes the status of the light unit.

This attribute is readonly.

Methods

initLightData

Method sets initial values of a control event.

Signature
void initLightData(VehicleLight lightId, boolean active);
Parameters
  • lightId
    • Optional: No.
    • Nullable: No
    • Type: VehicleLight
    • Description: specifies the control unit.
  • active
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: specifies if the unit is activated or not.

Interface ParkSensorsData

This interface defines an data related to the built-in park sensors. A listener can be registered by vehicle.addEventLister("parksensor-front",listener,false).

WebIDL
        interface ParkSensorsData : VehicleData{
                readonly attribute ParkSensorPosition position;
                readonly attribute unsigned short left;
                readonly attribute unsigned short midLeft;      
                readonly attribute unsigned short midRigth;
                readonly attribute unsigned short rigth;
                void initParkSensorsData(ParkSensorPosition position, short outLeft ,short left, short midLeft, short midRight, short right, short outRight);
        };
Code example
        webinos.vehicle.addEventListener("parksensor-front", psHandler, false);
        webinos.vehicle.addEventListener("parksensor-rear", psHandler, false);
        function psHandler(psEvent){
                if(psEvent.left == 20){
                        console.log("obstacle on the left in" + psEvent.position + " is close");
                }
        }
 

Attributes

readonly ParkSensorPosition position

Attribute defines the position of the sensor.

This attribute is readonly.
readonly unsigned short left

Attribute reflects the destination to an object sensed by the sensor on the left side in centimeters. Minimum distance is 20 centimeters. Maximum distance is 250 centimeters. A value of -1 indiactes that no object has been sensed.

This attribute is readonly.
readonly unsigned short midLeft

Attribute reflects the destination to an object sensed by the sensor on the middle left side in centimeters. Minimum distance is 20 centimeters. Maximum distance is 250 centimeters. A value of -1 indiactes that no object has been sensed.

This attribute is readonly.
readonly unsigned short midRigth

Attribute reflects the destination to an object sensed by the sensor on the middle right side in centimeters. Minimum distance is 20 centimeters. Maximum distance is 250 centimeters. A value of -1 indiactes that no object has been sensed.

This attribute is readonly.
readonly unsigned short rigth

Attribute reflects the destination to an object sensed by the sensor on the rigth side in centimeters. Minimum distance is 20 centimeters. Maximum distance is 250 centimeters. A value of -1 indiactes that no object has been sensed.

This attribute is readonly.

Methods

initParkSensorsData

Method sets initial values of a park sensors event.

Signature
void initParkSensorsData(ParkSensorPosition position, short outLeft, short left, short midLeft, short midRight, short right, short outRight);
Parameters
  • position
    • Optional: No.
    • Nullable: No
    • Type: ParkSensorPosition
    • Description: position of the sensors: front or rear.
  • outLeft
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description:
  • left
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: data from the left sensor. data from the outer left sensor.
  • midLeft
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: data from the middle left sensor.
  • midRight
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: data from the middle right sensor.
  • right
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: data from the right sensor.
  • outRight
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: data from the outer right sensor.

Interface TripComputerData

The interface defines a trip computer data. A listener can be registered by vehicle.addEventLister("tripcomputer",listener,false).

WebIDL
        interface TripComputerData : VehicleData{
                readonly attribute float averageConsumption;
                readonly attribute float tripConsumption;
                readonly attribute float averageSpeed;
                readonly attribute float tripSpeed;
                readonly attribute float tripDistance;
                readonly attribute float mileage;
                readonly attribute float range;
                void initTripComputerData(float averageConsumption, float tripConsumption, float averageSpeed, float tripSpeed, float tripDistance, float mileage, float range);
        };
Code example
var latestConsumption = 0;
webinos.vehicle.addEventListener("tripcomputer", tripDataHandler, false);
      
function tripDataHandler(data){
        //Calculating, if the fuel efficiency increased, since the last update
        var gap = latestConsumption - data.averageConsumption;
        if(gap < 0){
            console.log("Thumbs down. You decreased your fuel efficiency");
        } else if (gap > 0){
            console.log("Thumbs up. You increased your fuel efficiency");
        } else {
            console.log("nothing changed");
        }
        latestConsumption = data.averageConsumption;
      
        if (data.range < 20){
            console.log("You really need " + webinos.vehicle.fuel + "soon.");   
        }
}
 

Attributes

readonly float averageConsumption

Attrubute reflects the overall average consumption of the vehicle in l/100kilometers (resets on driver's demand).

This attribute is readonly.
readonly float tripConsumption

Attrubute reflects the average consumption of the vehicle in l/100kilometers on the ongoing journey (resets automatically).

This attribute is readonly.
readonly float averageSpeed

Attrubute reflects the overall average speed of the vehicle in kilometers per hour (resets on driver's demand).

This attribute is readonly.
readonly float tripSpeed

Attrubute reflects average speed of the vehicle in kilometers per hour on the current trip (resets automatically).

This attribute is readonly.
readonly float tripDistance

Attrubute reflects trip distance in kilometers.

This attribute is readonly.
readonly float mileage

Attrubute reflects mileage in kilometers.

This attribute is readonly.
readonly float range

Attrubute reflects the range of the vehicle in kilometers.

This attribute is readonly.

Methods

initTripComputerData

Method sets the initial values of a trip computer event.

Signature
void initTripComputerData(float averageConsumption, float tripConsumption, float averageSpeed, float tripSpeed, float tripDistance, float mileage, float range);
Parameters
  • averageConsumption
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: overall average consumption of the vehicle in l/100kilometers.
  • tripConsumption
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: average consumption of the vehicle in l/100kilometers on the current trip.
  • averageSpeed
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: average speed of the vehicle in kilometers per hour.
  • tripSpeed
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: average speed of the vehicle in kilometers per hour on the current trup.
  • tripDistance
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: distance of the current trip in kilometers.
  • mileage
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: overall driven distance in kilometers.
  • range
    • Optional: No.
    • Nullable: No
    • Type: float
    • Description: range of the vehicle in kilometers.

Interface GearData

This interface defines a gear data. A listener can be registered by vehicle.addEventLister("gear",listener,false).

WebIDL
        interface GearData : VehicleData{
                attribute Gear gear;
                
                void initGearData(Gear gear);         
        };
Code example
 // registering an Event for a Shift
 webinos.vehicle.addEventListener("gear", shiftHandler);
 function shiftHandler(e){
   document.getElementById("info").innerHTML = e.gear;
  webinos.vehicle.removeEventListener("shift", shiftHandler);
 }                              
 

Attributes

Gear gear

Attribute reflects the current gear.

Methods

initGearData

Method sets the value of the current gear.

Signature
void initGearData(Gear gear);
Parameters
  • gear
    • Optional: No.
    • Nullable: No
    • Type: Gear
    • Description: defines the value of the current gear.

Interface WiperData

This interface defines wiper data. A listener can be registered by vehicle.addEventLister("gear",listener,false).

WebIDL
        interface WiperData : VehicleData{
                attribute WiperStatus position;
                void initWiperData(WiperStatus position);
        };
Code example
 // requesting the status of the wiper stick.
 vehicle.get("wipers", wiperHandler);
 function wiperHandler(e){
   document.getElementById("info").innerHTML = e.position;
 }                              
 

Attributes

WiperStatus position

Attribute defines the position of the wiper stick.

Methods

initWiperData

Method sets the initial values of a wiper data.

Signature
void initWiperData(WiperStatus position);
Parameters
  • position
    • Optional: No.
    • Nullable: No
    • Type: WiperStatus
    • Description: defines the position of the wiper stick.

Interface EngineOilData

This interface defines a engine oil data.

WebIDL
        interface EngineOilData : VehicleData{
                attribute EngineOilLevel level;
                void initEngineOilData(EngineOilLevel level);        
        };

Attributes

EngineOilLevel level

Attribute defines the level of the oil in the engine.

Methods

initEngineOilData

Method sets the initial values of a engine oil data.

Signature
void initEngineOilData(EngineOilLevel level);
Parameters
  • level
    • Optional: No.
    • Nullable: No
    • Type: EngineOilLevel
    • Description: defines the level of the oil in the engine.

Dictionary SeatSetting

The interface defines the current setting of a given part of a seat.

WebIDL
        dictionary SeatSetting{
                SeatOption option;
                Long value; 
        };

Dictionary Members

SeatOption option

relevant seat part

Long value

value of the specified seat part

Interface SeatData

The interface defines a seating data.

WebIDL
        interface SeatData : VehicleData{
                readonly attribute SeatPosition position;
                readonly attribute SeatSetting[] settings;
                void initSeatData(SeatPosition position, SeatSetting[] settings);
        };

Methods

initSeatData

Method sets the initial values of a vehicle status event.

Signature
void initSeatData(SeatPosition position, SeatSetting[] settings);
Parameters
  • position
    • Optional: No.
    • Nullable: No
    • Type: SeatPosition
    • Description: defines the position of the seat.
  • settings
    • Optional: No.
    • Nullable: No
    • Type: array
    • Description: defines the settings of the different seat parts.

Interface TirePressureData

The interface defines a tire pressure data.

WebIDL
        interface TirePressureData : VehicleData{
                readonly attribute unsigned short frontLeft;
                readonly attribute unsigned short frontRight;
                readonly attribute unsigned short rearLeft;
                readonly attribute unsigned short rearRight;
                void initTirePressureData(Short frontLeft, Short frontRight,Short rearRight,Short rearLeft);
        };

Attributes

readonly unsigned short frontLeft

Attribute reflects the pressure of the front left tire in bar.

This attribute is readonly.
readonly unsigned short frontRight

Attribute reflects the pressure of the front right tire in bar.

This attribute is readonly.
readonly unsigned short rearLeft

Attribute reflects the pressure of the rear left tire in bar.

This attribute is readonly.
readonly unsigned short rearRight

Attribute reflects the pressure of the rear left tire in bar.

This attribute is readonly.

Methods

initTirePressureData

Method sets the initial values of tire pressure data.

Signature
void initTirePressureData(Short frontLeft, Short frontRight, Short rearRight, Short rearLeft);
Parameters
  • frontLeft
    • Optional: No.
    • Nullable: No
    • Type: Short
    • Description: defines the tire pressure of tire at the front left side of the vehicle.
  • frontRight
    • Optional: No.
    • Nullable: No
    • Type: Short
    • Description: defines the tire pressure of tire at the front right side of the vehicle.
  • rearRight
    • Optional: No.
    • Nullable: No
    • Type: Short
    • Description: defines the tire pressure of tire at the rear right side of the vehicle.
  • rearLeft
    • Optional: No.
    • Nullable: No
    • Type: Short
    • Description: defines the tire pressure of tire at the rear left side of the vehicle.

Interface DoorData

The interface defines door data.

WebIDL
        interface DoorData : VehicleData{
                readonly attribute boolean driver;
                readonly attribute boolean? frontPassenger;
                readonly attribute boolean? behindDriver;
                readonly attribute boolean? behindPassenger;
                readonly attribute boolean? trunkDeck;
                
                
                void initDoorData(boolean driver, boolean frontPassenger,boolean behindDriver,boolean behindPassenger,boolean trunkDeck);
        };
Code example
 // checking if driver door is openend.
 vehicle.addEventListener("doors", doorHandler);
 function doorHandler(doors){
  if(doors.driver){
        document.getElementById("info").innerHTML = 'Please close driver door';
  }  
 }                              
 

Attributes

readonly boolean driver

Attribute reflects if driver door is opened (true) or closed (false)

This attribute is readonly.
readonly boolean? frontPassenger

Attribute reflects if front passenger door is opened (true) or closed (false)

This attribute is readonly.
readonly boolean? behindDriver

Attribute reflects if the door behind the driver is opened (true) or closed (false)

This attribute is readonly.
readonly boolean? behindPassenger

Attribute reflects if the door behind the front passenger is opened (true) or closed (false).

This attribute is readonly.
readonly boolean? trunkDeck

Attribute reflects if the trunk deck is opened (true) or closed (false).

This attribute is readonly.

Methods

initDoorData

Method sets the initial values of a vehicle status event.

Signature
void initDoorData(boolean driver, boolean frontPassenger, boolean behindDriver, boolean behindPassenger, boolean trunkDeck);
Parameters
  • driver
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines status of driver door.
  • frontPassenger
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines status of front passenger door.
  • behindDriver
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines status of door behind driver.
  • behindPassenger
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines status of door behind front passenger.
  • trunkDeck
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines status of trunk deck.

Interface WindowData

The interface defines window data. WindowData exposes the information of the current position of the different windows of a vehicle.

WebIDL
                interface WindowData : VehicleData{
                readonly attribute unsigned short driver;
                readonly attribute unsigned short? frontPassenger;
                readonly attribute unsigned short? behindDriver;
                readonly attribute unsigned short? behindPassenger;
                
                
                void initWindowData(boolean driver, boolean frontPassenger,short behindDriver,short behindPassenger);
        };
Code example
 // checking if driver window is openend.
 vehicle.addEventListener("windows", windowHandler);
 function windowsHandler(windows){
  if(windows.driver == 0){
        document.getElementById("info").innerHTML = 'Window is closed';
  } else{
   document.getElementById("info").innerHTML = 'Driver window is opened to ' + window.driver + '%' ;
  }
 }                              
 

Attributes

readonly unsigned short driver

Attribute reflects the position of the driver window (100 = open; 0 = closed)

This attribute is readonly.
readonly unsigned short? frontPassenger

Attribute reflects the position of the front passenger window (100 = open; 0 = closed)

This attribute is readonly.
readonly unsigned short? behindDriver

Attribute reflects the position of the window behind the driver (100 = open; 0 = closed)

This attribute is readonly.
readonly unsigned short? behindPassenger

Attribute reflects the position of the window behind front passenger (100 = open; 0 = closed)

This attribute is readonly.

Methods

initWindowData

Method sets the initial values of a vehicle status event.

Signature
void initWindowData(boolean driver, boolean frontPassenger, short behindDriver, short behindPassenger);
Parameters
  • driver
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines position of the driver window.
  • frontPassenger
    • Optional: No.
    • Nullable: No
    • Type: boolean
    • Description: defines position of the front passenger window.
  • behindDriver
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: defines position of the .
  • behindPassenger
    • Optional: No.
    • Nullable: No
    • Type: short
    • Description: defines the position of the window behind the front passenger.

Callbacks

VehicleErrorCallback

callback for a failure from get Method

WebIDL
        callback VehicleErrorCallback = void (DOMError error);
Signature
void VehicleErrorCallback(DOMError error);
Parameters
  • error
    • Optional: No.
    • Nullable: No
    • Type: DOMError
    • Description: a DOMError containing information about the error (e.g. SecurityError if permission is denied).

VehicleDataHandler

callback method to receive vehicle data in a non-recurring and asynchronous way.

WebIDL
        callback VehicleDataHandler = void (VehicleData data);
Signature
void VehicleDataHandler(VehicleData data);
Parameters
  • data
    • Optional: No.
    • Nullable: No
    • Type: VehicleData
    • Description:

Enums

Fuel

Possible values for vehicle fuel

WebIDL
        enum Fuel { "unleaded", "premium", "diesel", "electric", "cng" };

Values

unleaded
premium
diesel
electric
cng

Hybrid

Possible hybrid types

WebIDL
        enum Hybrid { "none", "mild", "full"};

Values

none
mild
full

SteeringWheelPosition

Possible positions of the steering wheel

WebIDL
        enum SteeringWheelPosition {"right", "left"};

Values

right
left

VehicleTransmission

Possible values for transmission type

WebIDL
        enum VehicleTransmission { "transmission-automatic", "transmission-manual" };

Values

transmission-automatic
transmission-manual

VehicleClimateZone

Climate zone names

WebIDL
        enum VehicleClimateZone { "all", "driver", "passenger", "behind-driver", "behind-passenger"};

Values

all
driver
passenger
behind-driver
behind-passenger

VehicleLight

Type of vehicle light

WebIDL
        enum VehicleLight { "fog-front", "fog-rear", "signal-left", "signal-right", "signal-warn", "parking", "hibeam", "head" };

Values

fog-front
fog-rear
signal-left
signal-right
signal-warn
parking
hibeam
head

ParkSensorPosition

Position of park sensors

WebIDL
        enum ParkSensorPosition { "front", "rear"};

Values

front
rear

Gear

Vehicle gears

WebIDL
        enum Gear {"R","P","N", "1", "2", "3", "4", "5", "6", "7", "8", "10"};

supported gear values

Values

R
P
N
1
2
3
4
5
6
7
8
10

WiperStatus

Status of the wipers switch defines the different positions of the wiper switch

WebIDL
        enum WiperStatus { "front-wash", "rear-wash", "automatic", "front-once", "rear-once", "front-level1", "front-level2", "notactive" };

Values

front-wash
rear-wash
automatic
front-once
rear-once
front-level1
front-level2
notactive

EngineOilStatus

Levels of engine oil defines the different levels of engine oil.

WebIDL
        enum EngineOilStatus { "OVER_MAX","MAX", "OK", "MIN", "UNDER_MIN", "MEASURING"};

Values

OVER_MAX
MAX
OK
MIN
UNDER_MIN
MEASURING

SeatPosition

seat position. defines the different positions of a seat

WebIDL
        enum SeatPosition { "driver","frontpassaneger", "behindDriver", "behindPassenger"};

Values

driver
frontpassaneger
behindDriver
behindPassenger

SeatOption

seat option. defines the different parts of a seat, which can be customized

WebIDL
        enum SeatOption { "recline-seatback","slide", "cushion-heigh", "headrest", "back-cushion", "side-cushion"};

Values

recline-seatback
slide
cushion-heigh
headrest
back-cushion
side-cushion

VehicleDataType

Vehicle event types defines the possible vehicle data, which can be retrieved using the addEventListener or the get method.

WebIDL
        enum VehicleDataType {"gear","tripcomputer","parksensors-front", "parksensors-rear", "engineoil","wipers","tirepressure","doors", "windows", "climate-all", "climate-driver", "climate-behind-driver", "climate-passenger", "climate-behind-passenger", "light-fog-front", "light-fog-rear", "light-signal-left", "ligth-signal-right", "light-signal-warn", "light-parking", "light-hibeam", "light-head", "seat-driver", "seat-passenger", "seat-behind-driver", "seat-behind-passenger"};

Values

gear
tripcomputer
parksensors-front
parksensors-rear
engineoil
wipers
tirepressure
doors
windows
climate-all
climate-driver
climate-behind-driver
climate-passenger
climate-behind-passenger
light-fog-front
light-fog-rear
light-signal-left
ligth-signal-right
light-signal-warn
light-parking
light-hibeam
light-head
seat-driver
seat-passenger
seat-behind-driver
seat-behind-passenger

Features

This is the list of URIs used to declare this API's features, for use in the widget config.xml and as identifier for service type in service discovery functionality. For each URI, the list of functions covered is provided.

http://webinos.org/api/vehicle

Identifies the static information about the vehicle

http://webinos.org/api/vehicle.climate

Identifies vehicle data related to climate controls.

http://webinos.org/api/vehicle.parksensors

Identifies park sensor modules of a vehicle.

http://webinos.org/api/vehicle.tripcomputer

Identifies the trip computer information of a vehicle.

http://webinos.org/api/vehicle.lights

Identifies light data of a vehicle

http://webinos.org/api/vehicle.gearbox

Identifies gear data

http://webinos.org/api/vehicle.engineoil

Identifies information about engine oil level

http://webinos.org/api/vehicle.seating

Identifies information about engine oil level

http://webinos.org/api/vehicle.tires

Identifies information about the tires

http://webinos.org/api/vehicle.windows

Identifies information about the tire pressure

http://webinos.org/api/vehicle.doors

Identifies information about the doors

Full WebIDL

WebIDL
        [NoInterfaceObject]
        interface VehicleData : Event{
        
        };


        callback VehicleErrorCallback = void (DOMError error);
        
        callback VehicleDataHandler = void (VehicleData data);

        enum Fuel { "unleaded", "premium", "diesel", "electric", "cng" };
        
        enum Hybrid { "none", "mild", "full"};


        enum SteeringWheelPosition {"right", "left"};

        

        enum VehicleTransmission { "transmission-automatic", "transmission-manual" };
        
        [NoInterfaceObject]
        interface VehicleInterface : EventTarget {
                readonly attribute DOMString brand;
                readonly attribute DOMString model;
                readonly attribute DOMString year;
                readonly attribute Fuel fuel;
                readonly attribute Hybrid hybrid;
                readonly attribute SteeringWheelPosition steeringwheel;
                readonly attribute VehicleTransmission transmission;
                void get(VehicleDataType vehicleDataId, VehicleDataHandler handler, VehicleErrorCallback errorCB);
        };
        
        partial interface Webinos {
          readonly attribute VehicleInterface vehicle;
         };

        enum VehicleClimateZone { "all", "driver", "passenger", "behind-driver", "behind-passenger"};
        
        [NoInterfaceObject]
        interface ClimateControlData : VehicleData{
                readonly attribute VehicleClimateZone zone;
                readonly attribute unsigned short desiredTemperature; 
                readonly attribute boolean acStatus;
                readonly attribute unsigned short ventLevel;
                readonly attribute boolean ventMode;
                void initClimateControlData(boolean bubbles, boolean cancelable, DOMString zone, short desiredTemperature, boolean acStatus, short ventLevel, short ventMode);
        };

        enum VehicleLight { "fog-front", "fog-rear", "signal-left", "signal-right", "signal-warn", "parking", "hibeam", "head" };

        
        interface LightData : VehicleData{
                readonly attribute VehicleLight lightId;
                readonly attribute boolean active;
                void initLightData(VehicleLight lightId, boolean active);
        };

        enum ParkSensorPosition { "front", "rear"};

        interface ParkSensorsData : VehicleData{
                readonly attribute ParkSensorPosition position;
                readonly attribute unsigned short left;
                readonly attribute unsigned short midLeft;      
                readonly attribute unsigned short midRigth;
                readonly attribute unsigned short rigth;
                void initParkSensorsData(ParkSensorPosition position, short outLeft ,short left, short midLeft, short midRight, short right, short outRight);
        };

        interface TripComputerData : VehicleData{
                readonly attribute float averageConsumption;
                readonly attribute float tripConsumption;
                readonly attribute float averageSpeed;
                readonly attribute float tripSpeed;
                readonly attribute float tripDistance;
                readonly attribute float mileage;
                readonly attribute float range;
                void initTripComputerData(float averageConsumption, float tripConsumption, float averageSpeed, float tripSpeed, float tripDistance, float mileage, float range);
        };
        
        interface GearData : VehicleData{
                attribute Gear gear;
                
                void initGearData(Gear gear);         
        };
        

        enum Gear {"R","P","N", "1", "2", "3", "4", "5", "6", "7", "8", "10"};
        
        enum WiperStatus { "front-wash", "rear-wash", "automatic", "front-once", "rear-once", "front-level1", "front-level2", "notactive" };
        
        interface WiperData : VehicleData{
                attribute WiperStatus position;
                void initWiperData(WiperStatus position);
        };
        
        interface EngineOilData : VehicleData{
                attribute EngineOilLevel level;
                void initEngineOilData(EngineOilLevel level);        
        };
        
        enum EngineOilStatus { "OVER_MAX","MAX", "OK", "MIN", "UNDER_MIN", "MEASURING"};



        dictionary SeatSetting{
                SeatOption option;
                Long value; 
        };
        
        interface SeatData : VehicleData{
                readonly attribute SeatPosition position;
                readonly attribute SeatSetting[] settings;
                void initSeatData(SeatPosition position, SeatSetting[] settings);
        };
        
        enum SeatPosition { "driver","frontpassaneger", "behindDriver", "behindPassenger"};
        
        enum SeatOption { "recline-seatback","slide", "cushion-heigh", "headrest", "back-cushion", "side-cushion"};

        interface TirePressureData : VehicleData{
                readonly attribute unsigned short frontLeft;
                readonly attribute unsigned short frontRight;
                readonly attribute unsigned short rearLeft;
                readonly attribute unsigned short rearRight;
                void initTirePressureData(Short frontLeft, Short frontRight,Short rearRight,Short rearLeft);
        };
        
        interface DoorData : VehicleData{
                readonly attribute boolean driver;
                readonly attribute boolean? frontPassenger;
                readonly attribute boolean? behindDriver;
                readonly attribute boolean? behindPassenger;
                readonly attribute boolean? trunkDeck;
                
                
                void initDoorData(boolean driver, boolean frontPassenger,boolean behindDriver,boolean behindPassenger,boolean trunkDeck);
        };
        
                interface WindowData : VehicleData{
                readonly attribute unsigned short driver;
                readonly attribute unsigned short? frontPassenger;
                readonly attribute unsigned short? behindDriver;
                readonly attribute unsigned short? behindPassenger;
                
                
                void initWindowData(boolean driver, boolean frontPassenger,short behindDriver,short behindPassenger);
        };
        
        
        enum VehicleDataType {"gear","tripcomputer","parksensors-front", "parksensors-rear", "engineoil","wipers","tirepressure","doors", "windows", "climate-all", "climate-driver", "climate-behind-driver", "climate-passenger", "climate-behind-passenger", "light-fog-front", "light-fog-rear", "light-signal-left", "ligth-signal-right", "light-signal-warn", "light-parking", "light-hibeam", "light-head", "seat-driver", "seat-passenger", "seat-behind-driver", "seat-behind-passenger"};