Sensor API

The Sensor API defines interfaces and methods to manage sensor data from various sensors on the device.

The following sensor functionality is provided:

  • Start and stop sensor
  • Set and unset notification of the sensor data change
  • Get current sensor data

For more information about how to use Sensor API, see Device Sensors Guide.

Since: 2.3

Table of Contents


Summary of Interfaces and Methods

Interface Method
SensorServiceManagerObject
SensorService
Sensor
void start (SuccessCallback successCallback, optional ErrorCallback? errorCallback)
void stop ()
HRMRawSensor
void getHRMRawSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
LightSensor
void getLightSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
MagneticSensor
void getMagneticSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
PressureSensor
void getPressureSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
ProximitySensor
void getProximitySensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
UltravioletSensor
void getUltravioletSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
SensorData
SensorHRMRawData
SensorLightData
SensorMagneticData
SensorPressureData
SensorProximityData
SensorUltravioletData
SensorDataSuccessCallback
void onsuccess (optional SensorData? sensorData)

1. Type Definitions

1.1. MagneticSensorAccuracy

Specifies the accuracy of magnetic sensor data.
  enum MagneticSensorAccuracy { "ACCURACY_UNDEFINED", "ACCURACY_BAD", "ACCURACY_NORMAL", "ACCURACY_GOOD", "ACCURACY_VERYGOOD" };

Since: 2.3

  • ACCURACY_UNDEFINED - Corresponds to undefined magnetic sensor accuracy.
  • ACCURACY_BAD - Corresponds to bad magnetic sensor accuracy.
  • ACCURACY_NORMAL - Corresponds to normal magnetic sensor accuracy.
  • ACCURACY_GOOD - Corresponds to good magnetic sensor accuracy.
  • ACCURACY_VERYGOOD - Corresponds to very good magnetic sensor accuracy.

1.2. ProximityState

Specifies the proximity state.
  enum ProximityState { "FAR", "NEAR" };

Since: 2.3

  • FAR - Corresponds to far proximity state.
  • NEAR - corresponds to near proximity state.

1.3. SensorType

Specifies the sensor type available to the API.
  enum SensorType { "HRM_RAW", "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };

Since: 2.3

The sensor types defined by this enumerator are:

  • HRM_RAW - HRM sensor
  • LIGHT - Light sensor
  • MAGNETIC - Magnetic sensor
  • PRESSURE - Pressure sensor
  • PROXIMITY - Proximity sensor
  • ULTRAVIOLET - Ultraviolet sensor

Remark: HRM_RAW is supported since Tizen 2.3.1

2. Interfaces

2.1. SensorServiceManagerObject

The SensorServiceManagerObject interface defines what is instantiated by the Tizen object. The tizen.sensorservice object allows access to various sensors of the Tizen device.
  [NoInterfaceObject] interface SensorServiceManagerObject {
    readonly attribute SensorService sensorservice;
  };
  Tizen implements SensorServiceManagerObject;

Since: 2.3

Attributes

  • readonly SensorService sensorservice
    Object representing a sensor service.

    Since: 2.3

2.2. SensorService

The SensorService interface provides methods to access the sensor.
  [NoInterfaceObject] interface SensorService {
    Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
    SensorType[] getAvailableSensors() raises(WebAPIException);
  };

Since: 2.3

Methods

getDefaultSensor
Gets the default sensor of the device for the given sensor type.
Sensor getDefaultSensor(SensorType type);

Since: 2.3

The supported sensor types are hardware-dependent.

To check if the given type is supported or not, System Info API can be used.

  • HRM_RAW - HRM_RAW is supported, if at least one HRM LED sensor type is supported:
    tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor.led_green"),
    tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor.led_ir"),
    tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor.led_red")
  • LIGHT - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.photometer")
  • MAGNETIC - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.magnetometer")
  • PRESSURE - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.barometer")
  • PROXIMITY - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.proximity")
  • ULTRAVIOLET - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.ultraviolet")

Parameters:

  • type: Sensor type to access.
    • Conditional privilege: For using HRM_RAW value, privilege http://tizen.org/privilege/healthinfo (public level) is needed since Tizen 2.3.1.

Return value:

    Sensor: Default sensor object.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if accessing a given sensor type fails because of an unknown error.

    • with error type NotSupportedError, if the given type is not supported on the device.

    • with error type SecurityError, this error is only thrown for HRM_RAW sensor type when an application does not have http://tizen.org/privilege/healthinfo privilege in config.xml.

Code example:

var proximityCapability =
    tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.proximity");

if (proximityCapability === true)
{
  /* Device supports proximity sensor and you can get proximity sensor's data. */
  var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
}
else
{
  /* If tizen.sensorservice.getDefaultSensor("PROXIMITY") is used, NotSupportedError is thrown. */
  console.log("Proximity sensor is not supported on this device");
}
getAvailableSensors
Gets the available sensor types.
SensorType[] getAvailableSensors();

Since: 2.3

Return value:

    SensorType[]: All available sensor types.

Exceptions:

  • WebAPIException
    • with error type UnknownError, if getting available sensor type fails because of an unknown error.

Code example:

var sensorCapabilities = tizen.sensorservice.getAvailableSensors();

console.log("Capable sensor: " + sensorCapabilities[0]);

2.3. Sensor

The Sensor interface is a base interface for specific sensor interfaces. It provides methods common to all sensor types.
  [NoInterfaceObject] interface Sensor {
    readonly attribute SensorType sensorType;
    void start(SuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
    void stop() raises(WebAPIException);
    void setChangeListener(SensorDataSuccessCallback successCallback) raises(WebAPIException);
    void unsetChangeListener() raises(WebAPIException);
  };

Since: 2.3

Attributes

  • readonly SensorType sensorType
    Sensor type to monitor the changes.

    Since: 2.3

Methods

start
Starts the sensor.
void start(SuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

The SuccessCallback will be invoked when the first event from the sensor is fired.

The ErrorCallback method is launched with these error types:

  • NotSupportedError - if the sensor is not supported on the device.
  • UnknownError - if starting the sensor fails because of an unknown error.

Parameters:

  • successCallback: Callback method to be invoked when sensor has been successfully started.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");

function onsuccessCB()
{
  console.log("The proximity sensor started successfully");
}

proximitySensor.start(onsuccessCB);
stop
Stops the sensor.
void stop();

Since: 2.3

Exceptions:

  • WebAPIException
    • with error type UnknownError, if stopping the sensor fails because of an unknown error.

Code example:

var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");

function onsuccessCB()
{
  console.log("Proximity sensor start");
  proximitySensor.stop();
}

proximitySensor.start(onsuccessCB);
setChangeListener
Registers a listener to retrieve sensor data periodically.
void setChangeListener(SensorDataSuccessCallback successCallback);

Since: 2.3

Note that the setChangeListener() method only registers the listener. The start() method must be called to turn on the sensor, or the sensor data will not change.

Remark: The specified interval is only a suggested interval between sensor measurements. You will get at least one sensor measurement within the interval you specify, but the actual interval between sensor measurements can be affected by other applications and the system. To reduce the system overhead, it is recommended to set the longest interval that you can, because the system usually chooses the shortest interval among all intervals specified.

Parameters:

  • successCallback: Callback method to be invoked periodically.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if registering the listener fails because of an unknown error.

    • with error type NotSupportedError, if the batchLatency is not supported on the sensor hardware.

    • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

Code example:

var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");

function onsuccessCB()
{
  console.log("Light sensor start");
}

function onchangedCB(sensorData)
{
  console.log("Light level: " + sensorData.lightLevel);
}

lightSensor.setChangeListener(onchangedCB);

lightSensor.start(onsuccessCB);
unsetChangeListener
Unregisters the sensor data change listener.
void unsetChangeListener();

Since: 2.3

Calling this function has no effect if listener is not set.

Exceptions:

  • WebAPIException
    • with error type UnknownError, if unregistering the listener fails because of an unknown error.

Code example:

var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");

function onchangedCB(sensorData)
{
  console.log("Proximity distance: " + sensorData.proximityState);
}

proximitySensor.setChangeListener(onchangedCB);

proximitySensor.unsetChangeListener();

2.4. HRMRawSensor

The HRMRawSensor interface provides methods to access HRM sensor raw data.
  [NoInterfaceObject] interface HRMRawSensor : Sensor {
    void getHRMRawSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
  };

Since: 2.3.1

Methods

getHRMRawSensorData
Gets the current sensor data.
void getHRMRawSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3.1

Note that before calling the getHRMRawSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getHRMRawSensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Privilege level: public

Privilege: http://tizen.org/privilege/healthinfo

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

    • with error type SecurityError, if the application does not have the privilege to use this function.

Code example:

var HRMrawsensor = tizen.sensorservice.getDefaultSensor("HRM_RAW");

function onGetSuccessCB(sensorData)
{
  console.log("HRMRaw light intensity: " + sensorData.lightIntensity);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("HRMRaw sensor start");
  HRMrawsensor.getHRMRawSensorData(onGetSuccessCB, onerrorCB);
}

HRMrawsensor.start(onsuccessCB);

2.5. LightSensor

The LightSensor interface provides methods to access light sensor data.
  [NoInterfaceObject] interface LightSensor : Sensor {
    void getLightSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
  };

Since: 2.3

Methods

getLightSensorData
Gets the current sensor data.
void getLightSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

Note that before calling the getLightSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getLightSensorData() method is called without first calling the start() method
  • UnknownError : An unknown error has occurred

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");

function onGetSuccessCB(sensorData)
{
  console.log("Light level: " + sensorData.lightLevel);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("Sensor start");
  lightSensor.getLightSensorData(onGetSuccessCB, onerrorCB);
}

lightSensor.start(onsuccessCB);

2.6. MagneticSensor

The MagneticSensor interface provides methods to access magnetic sensor data.
  [NoInterfaceObject] interface MagneticSensor : Sensor {
    void getMagneticSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                               raises(WebAPIException);
  };

Since: 2.3

Methods

getMagneticSensorData
Gets the current sensor data.
void getMagneticSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

Note that before calling the getMagneticSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getMagneticSensorData() method is called without first calling the start() method
  • UnknownError : An unknown error has occurred

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var magneticSensor = tizen.sensorservice.getDefaultSensor("MAGNETIC");

function onGetSuccessCB(sensorData)
{
  console.log("Magnetic field of the X axis: " + sensorData.x);
  console.log("Magnetic field of the Y axis: " + sensorData.y);
  console.log("Magnetic field of the Z axis: " + sensorData.z);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("Sensor start");
  magneticSensor.getMagneticSensorData(onGetSuccessCB, onerrorCB);
}

magneticSensor.start(onsuccessCB);

2.7. PressureSensor

The PressureSensor interface provides methods to access pressure sensor data.
  [NoInterfaceObject] interface PressureSensor : Sensor {
    void getPressureSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                               raises(WebAPIException);
  };

Since: 2.3

Methods

getPressureSensorData
Gets the current sensor data.
void getPressureSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

Note that the start() method should be called before calling the getPressureSensorData() method to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getPressureSensorData() method is called without first calling the start() method
  • UnknownError : An unknown error has occurred

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var pressureSensor = tizen.sensorservice.getDefaultSensor("PRESSURE");

function onGetSuccessCB(sensorData)
{
  console.log("Pressure: " + sensorData.pressure);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("Sensor start");
  pressureSensor.getPressureSensorData(onGetSuccessCB, onerrorCB);
}

pressureSensor.start(onsuccessCB);

2.8. ProximitySensor

The ProximitySensor interface provides methods to access proximity sensor data.
  [NoInterfaceObject] interface ProximitySensor : Sensor {
    void getProximitySensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                raises(WebAPIException);
  };

Since: 2.3

Methods

getProximitySensorData
Gets the current sensor data.
void getProximitySensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

Note that before calling the getProximitySensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getProximitySensorData() method is called without first calling the start() method
  • UnknownError : An unknown error has occurred

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");

function onGetSuccessCB(sensorData)
{
  console.log("Proximity state: " + sensorData.proximityState);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("Proximity sensor start");
  proximitySensor.getProximitySensorData(onGetSuccessCB, onerrorCB);
}

proximitySensor.start(onsuccessCB);

2.9. UltravioletSensor

The UltravioletSensor interface provides methods to access ultraviolet sensor data.
  [NoInterfaceObject] interface UltravioletSensor : Sensor {
    void getUltravioletSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                  raises(WebAPIException);
  };

Since: 2.3

Methods

getUltravioletSensorData
Gets the current sensor data.
void getUltravioletSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);

Since: 2.3

Note that before calling the getUltravioletSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getUltravioletSensorData() method is called without first calling the start() method
  • UnknownError : An unknown error has occurred

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read.
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

Code example:

var ultravioletSensor = tizen.sensorservice.getDefaultSensor("ULTRAVIOLET");

function onGetSuccessCB(sensorData)
{
  console.log("Ultraviolet level: " + sensorData.ultravioletLevel);
}

function onerrorCB(error)
{
  console.log("Error occurred");
}

function onsuccessCB()
{
  console.log("Ultraviolet sensor start");
  ultravioletSensor.getUltravioletSensorData(onGetSuccessCB, onerrorCB);
}

ultravioletSensor.start(onsuccessCB);

2.10. SensorData

The SensorData interface is a common abstract interface used by different types of sensor data objects.
  [NoInterfaceObject] interface SensorData {
  };

Since: 2.3

2.11. SensorHRMRawData

The SensorHRMRawData interface represents HRM sensor raw data.
  [NoInterfaceObject] interface SensorHRMRawData : SensorData {
    readonly attribute DOMString lightType;
    readonly attribute unsigned long lightIntensity;
  };

Since: 2.3.1

Attributes

  • readonly DOMString lightType
    HRM sensor light type.

    The following values are supported:

    • LED_IR - The infrared spectrum
    • LED_RED - The red light spectrum
    • LED_GREEN - The green light spectrum

    Since: 2.3.1

  • readonly unsigned long lightIntensity
    HRM sensor light intensity measures the light intensity that is reflected from a blood vessel. The changes in the reported value represent blood volume changes in the microvascular bed of the tissue, and can be used to estimate heart rate.

    Since: 2.3.1

2.12. SensorLightData

The SensorLightData interface represents light sensor data.
  [NoInterfaceObject] interface SensorLightData : SensorData {
    readonly attribute double lightLevel;
  };

Since: 2.3

Attributes

  • readonly double lightLevel
    Ambient light level in lux.

    Since: 2.3

2.13. SensorMagneticData

The SensorMagneticData interface represents magnetic sensor data.
  [NoInterfaceObject] interface SensorMagneticData : SensorData {
    readonly attribute double x;
    readonly attribute double y;
    readonly attribute double z;
    readonly attribute MagneticSensorAccuracy accuracy;
  };

Since: 2.3

Attributes

  • readonly double x
    Ambient magnetic field of the X axis in microtesla (µT).

    Since: 2.3

  • readonly double y
    Ambient magnetic field of the Y axis in microtesla (µT).

    Since: 2.3

  • readonly double z
    Ambient magnetic field of the Z axis in microtesla (µT).

    Since: 2.3

  • readonly MagneticSensorAccuracy accuracy
    Accuracy of magnetic sensor data.

    For increasing the accuracy, wave the device around in the air in figure-eight patterns.

    Since: 2.3

2.14. SensorPressureData

The SensorPressureData interface represents pressure sensor data.
  [NoInterfaceObject] interface SensorPressureData : SensorData {
    readonly attribute double pressure;
  };

Since: 2.3

Attributes

  • readonly double pressure
    Pressure in hectopascal (hPa).

    Since: 2.3

2.15. SensorProximityData

The SensorProximityData interface represents proximity sensor data.
  [NoInterfaceObject] interface SensorProximityData : SensorData {
    readonly attribute ProximityState proximityState;
  };

Since: 2.3

Attributes

  • readonly ProximityState proximityState
    Proximity state.

    Since: 2.3

2.16. SensorUltravioletData

The SensorUltravioletData interface represents ultraviolet sensor data.
  [NoInterfaceObject] interface SensorUltravioletData : SensorData {
    readonly attribute long ultravioletLevel;
  };

Since: 2.3

Attributes

  • readonly long ultravioletLevel
    Ultraviolet index.

    The ultraviolet index is an international standard measurement of the strength of ultraviolet radiation from the sun. The ultravioletLevel ranges from 0 to 15.

    Since: 2.3

2.17. SensorDataSuccessCallback

The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
  [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
    void onsuccess(optional SensorData? sensorData);
  };

Since: 2.3

Methods

onsuccess
Called periodically.
void onsuccess(optional SensorData? sensorData);

Since: 2.3

Parameters:

  • sensorData [optional] [nullable]: Current sensor data.

3. Related Feature

Method tizen.systeminfo.getCapability() can be used in application runtime to check whether this API is supported.

To guarantee that the Heart Rate Monitor application runs on a device with a heart rate monitor, declare the following feature requirements in the config file:

  • http://tizen.org/feature/sensor.heart_rate_monitor
  • To guarantee that the light sensor application runs on a device with a photometer (light) sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.photometer
  • To guarantee that the magnetic sensor application runs on a device with a magnetic sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.magnetometer
  • To guarantee that the barometer(pressure) sensor application runs on a device with a barometric (pressure) sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.barometer
  • To guarantee that the proximity sensor application runs on a device with a proximity sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.proximity
  • To guarantee that the UV sensor application runs on a device with a UV sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.ultraviolet
  • For more information, see Application Filtering.

    4. Full WebIDL

    module Sensor {
      enum MagneticSensorAccuracy { "ACCURACY_UNDEFINED", "ACCURACY_BAD", "ACCURACY_NORMAL", "ACCURACY_GOOD", "ACCURACY_VERYGOOD" };
      enum ProximityState { "FAR", "NEAR" };
      enum SensorType { "HRM_RAW", "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };
      Tizen implements SensorServiceManagerObject;
      [NoInterfaceObject] interface SensorServiceManagerObject {
        readonly attribute SensorService sensorservice;
      };
      [NoInterfaceObject] interface SensorService {
        Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
        SensorType[] getAvailableSensors() raises(WebAPIException);
      };
      [NoInterfaceObject] interface Sensor {
        readonly attribute SensorType sensorType;
        void start(SuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
        void stop() raises(WebAPIException);
        void setChangeListener(SensorDataSuccessCallback successCallback) raises(WebAPIException);
        void unsetChangeListener() raises(WebAPIException);
      };
      [NoInterfaceObject] interface HRMRawSensor : Sensor {
        void getHRMRawSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
      };
      [NoInterfaceObject] interface LightSensor : Sensor {
        void getLightSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
      };
      [NoInterfaceObject] interface MagneticSensor : Sensor {
        void getMagneticSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                   raises(WebAPIException);
      };
      [NoInterfaceObject] interface PressureSensor : Sensor {
        void getPressureSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                   raises(WebAPIException);
      };
      [NoInterfaceObject] interface ProximitySensor : Sensor {
        void getProximitySensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                    raises(WebAPIException);
      };
      [NoInterfaceObject] interface UltravioletSensor : Sensor {
        void getUltravioletSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
                                      raises(WebAPIException);
      };
      [NoInterfaceObject] interface SensorData {
      };
      [NoInterfaceObject] interface SensorHRMRawData : SensorData {
        readonly attribute DOMString lightType;
        readonly attribute unsigned long lightIntensity;
      };
      [NoInterfaceObject] interface SensorLightData : SensorData {
        readonly attribute double lightLevel;
      };
      [NoInterfaceObject] interface SensorMagneticData : SensorData {
        readonly attribute double x;
        readonly attribute double y;
        readonly attribute double z;
        readonly attribute MagneticSensorAccuracy accuracy;
      };
      [NoInterfaceObject] interface SensorPressureData : SensorData {
        readonly attribute double pressure;
      };
      [NoInterfaceObject] interface SensorProximityData : SensorData {
        readonly attribute ProximityState proximityState;
      };
      [NoInterfaceObject] interface SensorUltravioletData : SensorData {
        readonly attribute long ultravioletLevel;
      };
      [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
        void onsuccess(optional SensorData? sensorData);
      };
    };