From 5e5316777e331210a8b477ad4a3f042367ab02b7 Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Wed, 13 Apr 2016 13:48:02 +0200 Subject: [PATCH] [Sensor] Update API reference Change-Id: I0768f9935ba5e91fefa58538ff1cf7eb2e0ab330 Signed-off-by: Lukasz Bardeli --- .../html/device_api/wearable/tizen/sensor.html | 783 ++++++++++++++++++--- 1 file changed, 674 insertions(+), 109 deletions(-) diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html index 140656a..6292772 100644 --- a/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html +++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html @@ -35,11 +35,14 @@ For more information about how to use Sensor API, see
  • 1. Type Definitions
  • @@ -62,21 +65,33 @@ For more information about how to use Sensor API, see HRMRawSensor -
  • 2.10. SensorData +
  • 2.10. GravitySensor
  • -
  • 2.11. SensorLightData +
  • 2.11. GyroscopeSensor
  • -
  • 2.12. SensorMagneticData +
  • 2.12. GyroscopeRotationVectorSensor
  • -
  • 2.13. SensorPressureData +
  • 2.13. SensorData
  • -
  • 2.14. SensorProximityData +
  • 2.14. SensorLightData
  • -
  • 2.15. SensorUltravioletData +
  • 2.15. SensorMagneticData
  • -
  • 2.16. SensorHRMRawData +
  • 2.16. SensorPressureData
  • -
  • 2.17. SensorDataSuccessCallback +
  • 2.17. SensorProximityData +
  • +
  • 2.18. SensorUltravioletData +
  • +
  • 2.19. SensorHRMRawData +
  • +
  • 2.20. SensorGravityData +
  • +
  • 2.21. SensorGyroscopeData +
  • +
  • 2.22. SensorGyroscopeRotationVectorData +
  • +
  • 2.23. SensorDataSuccessCallback
  • @@ -100,39 +115,56 @@ For more information about how to use Sensor API, see SensorService -Sensor getDefaultSensor (SensorType type)
    - SensorType[] getAvailableSensors () +
    +Sensor getDefaultSensor (SensorType type)
    +
    +SensorType[] getAvailableSensors ()
    + Sensor -void start (SuccessCallback successCallback, optional ErrorCallback? errorCallback)
    - void stop ()
    - void setChangeListener (SensorDataSuccessCallback successCallback, optional long? interval)
    - void unsetChangeListener () + +
    void start (SuccessCallback successCallback, optional ErrorCallback? errorCallback)
    +
    void stop ()
    +
    void setChangeListener (SensorDataSuccessCallback successCallback, optional long? interval)
    +
    void unsetChangeListener ()
    + LightSensor -void getLightSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getLightSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    MagneticSensor -void getMagneticSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getMagneticSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    PressureSensor -void getPressureSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getPressureSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    ProximitySensor -void getProximitySensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getProximitySensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    UltravioletSensor -void getUltravioletSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getUltravioletSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    HRMRawSensor -void getHRMRawSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +
    void getHRMRawSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + + +GravitySensor +
    void getGravitySensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + + +GyroscopeSensor +
    void getGyroscopeSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + + +GyroscopeRotationVectorSensor +
    void getGyroscopeRotationVectorSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    SensorData @@ -163,8 +195,20 @@ For more information about how to use Sensor API, see SensorGravityData + + + +SensorGyroscopeData + + + +SensorGyroscopeRotationVectorData + + + SensorDataSuccessCallback -void onsuccess (optional SensorData? sensorData) +
    void onsuccess (optional SensorData? sensorData)
    @@ -175,7 +219,7 @@ For more information about how to use Sensor API, see Specifies the sensor type available to the API. -
        enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" };
    +
        enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };

    Since: 2.3 @@ -197,11 +241,20 @@ PROXIMITY - Proximity sensor ULTRAVIOLET - Ultraviolet sensor

  • HRM_RAW - HRM sensor
  • +
  • +GRAVITY - Gravity sensor
  • +
  • +GYROSCOPE - Gyroscope sensor
  • +
  • +GYROSCOPE_ROTATION_VECTOR - Gyroscope rotation vector sensor
  • Remark : HRM_RAW is supported since Tizen 2.3.1

    +

    Remark : + GRAVITY, GYROSCOPE and GYROSCOPE_ROTATION_VECTOR are supported since Tizen 3.0 +

    1.2. ProximityState

    @@ -291,7 +344,13 @@ The supported sensor types are hardware-dependent.

    To check if the given
  • ULTRAVIOLET - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.ultraviolet")
  • - HRM_RAW - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor")
  • + HRM_RAW - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.heart_rate_monitor") +
  • + GRAVITY - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gravity")
  • +
  • + GYROSCOPE - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope")
  • +
  • + GYROSCOPE_ROTATION_VECTOR - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope_rotation_vector")
  • @@ -303,13 +362,13 @@ The supported sensor types are hardware-dependent.

    To check if the given http://tizen.org/privilege/healthinfo

    Remark : - http://tizen.org/privilege/healthinfo is required only for HRM_RAW type. HRM_RAW is supported since Tizen 2.3.1 + http://tizen.org/privilege/healthinfo is required only for HRM_RAW type. HRM_RAW is supported since Tizen 2.3.1.

    Parameters:

    • -type: +type: Sensor type to access
    @@ -362,17 +421,6 @@ The supported sensor types are hardware-dependent.

    To check if the given Since: 2.3

    -

    - Privilege level: - public -

    -

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

    -

    Remark : - http://tizen.org/privilege/healthinfo is required only for HRM_RAW type. HRM_RAW is supported since Tizen 2.3.1. -

    Return value:

    SensorType[] All available sensor types @@ -449,11 +497,11 @@ The supported sensor types are hardware-dependent.

    To check if the given

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when sensor has been successfully started
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -518,7 +566,7 @@ The supported sensor types are hardware-dependent.

    To check if the given
    - Registers a change listener to be called when sensor data of the given type changes. + Registers a listener to retrieve sensor data periodically.
    void setChangeListener(SensorDataSuccessCallback successCallback, optional long? interval);
                  
    @@ -532,21 +580,23 @@ 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: interval is supported since Tizen 3.0

    +

    Remark : + interval is supported since Tizen 3.0 +

    +

    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: +successCallback: Callback method to be invoked periodically. -
    • +
    • -interval - [optional] [nullable]: -The period in milliseconds at which sensor data will be sent to the application which calls this method.
      - interval should be in range <10, 1000> inclusively. However, if it is null or zero, it will be set to the default value of 100 ms.
      -For the PROXIMITY sensor type, interval will be ignored. -
    • +interval [optional] [nullable]: + The interval in milliseconds (ms) at which sensor data will be sent to the Web Application which calls this method since Tizen 3.0
      interval can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set to the default value of 100ms.
      For the PROXIMITY sensor type, interval will be ignored. +
    @@ -565,8 +615,7 @@ For the PROXIMITY sensor type, interval will
    -

    Code example:

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

    Code example:

     var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
     
      function onsuccessCB() {
          console.log("proximity sensor start");
    @@ -576,28 +625,10 @@ For the PROXIMITY sensor type, interval will
          console.log("proximity distance : " + sensorData.proximityState);
      }
     
    - // order to receive proximity sensor data every 100 ms (default value):
    - proximitySensor.setChangeListener(onchangedCB);
    + // interval can be ommitted.
    + proximitySensor.setChangeListener(onchangedCB, 200);
     
    - // start the sensor service to begin receiving events:
      proximitySensor.start(onsuccessCB);
    - 
    -

    Code example:

    - var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");
    -
    - function onSuccessCB() {
    -   console.log("Light sensor service has started.");
    - }
    -
    - function onChangedCB(sensorData) {
    -   console.log("Current light level: " + sensorData.lightLevel);
    - }
    -
    - // order to receive light sensor data every 500 ms:
    - lightSensor.setChangeListener(onChangedCB, 500);
    -
    - // start the sensor service to begin receiving events:
    - lightSensor.start(onSuccessCB);
      
    @@ -651,7 +682,7 @@ For the PROXIMITY sensor type, interval will Since: 2.3

    - +

    Methods

    @@ -686,11 +717,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -740,7 +771,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Methods

    @@ -775,11 +806,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -831,7 +862,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Methods

    @@ -866,11 +897,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -920,7 +951,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Methods

    @@ -955,11 +986,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -1009,7 +1040,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Methods

    @@ -1044,11 +1075,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -1098,7 +1129,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3.1

    - +

    Methods

    @@ -1141,11 +1172,11 @@ The ErrorCallback method is launched with these error types:

    Parameters:

    • -successCallback: +successCallback: Callback method to be invoked when the sensor data has been read
    • -errorCallback [optional] [nullable]: +errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs
    @@ -1189,8 +1220,282 @@ The ErrorCallback method is launched with these error types:
    +
    +

    2.10. GravitySensor

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

    + Since: + 3.0 +

    + +
    +

    Methods

    +
    +
    +getGravitySensorData +
    +
    +
    + Gets the current gravity sensor data. You can refer to the SensorGravityData interface. +
    +
    void getGravitySensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 3.0 +

    +
    +

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

    +

    +The ErrorCallback method is launched with these error types: +

    +
      +
    • + ServiceNotAvailableError : If the getGravitySensorData() method is called without first calling the start() method
    • +
    • + AbortError : If the system operation was aborted
    • +
    +
    +
    +

    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 gravitySensor = tizen.sensorservice.getDefaultSensor("GRAVITY");
    +
    + function onGetSuccessCB(sensorData) {
    +     console.log("######## Get the gravity sensor data ########");
    +     console.log("x: " + sensorData.x);
    +     console.log("y: " + sensorData.y);
    +     console.log("z: " + sensorData.z);
    + }
    +
    + function onerrorCB(error) {
    +     console.log("error occurs");
    + }
    +
    + function onsuccessCB() {
    +     console.log("sensor start");
    +     gravitySensor.getGravitySensorData(onGetSuccessCB, onerrorCB);
    + }
    +
    + gravitySensor.start(onsuccessCB);
    + 
    +
    +
    +
    +
    +
    +
    +

    2.11. GyroscopeSensor

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

    + Since: + 3.0 +

    + +
    +

    Methods

    +
    +
    +getGyroscopeSensorData +
    +
    +
    + Gets the current gyroscope sensor data. You can refer to the SensorGyroscopeData interface. +
    +
    void getGyroscopeSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 3.0 +

    +
    +

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

    +

    +The ErrorCallback method is launched with these error types: +

    +
      +
    • + ServiceNotAvailableError : If the getGyroscopeSensorData() method is called without first calling the start() method
    • +
    • + AbortError : If the system operation was aborted
    • +
    +
    +
    +

    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 gyroscopeSensor = tizen.sensorservice.getDefaultSensor("GYROSCOPE");
    +
    + function onGetSuccessCB(sensorData) {
    +     console.log("######## Get the gyroscope sensor date ########");
    +     console.log("x: " + sensorData.x);
    +     console.log("y: " + sensorData.y);
    +     console.log("z: " + sensorData.z);
    + }
    +
    + function onerrorCB(error) {
    +     console.log("error occurs");
    + }
    +
    + function onsuccessCB() {
    +     console.log("sensor start");
    +     gyroscopeSensor.getGyroscopeSensorData(onGetSuccessCB, onerrorCB);
    + }
    +
    + gyroscopeSensor.start(onsuccessCB);
    + 
    +
    +
    +
    +
    +
    +
    +

    2.12. GyroscopeRotationVectorSensor

    +
    + The GyroscopeRotationVectorSensor interface provides methods to access gyroscope rotation vector sensor data. +
    +
        [NoInterfaceObject] interface GyroscopeRotationVectorSensor : Sensor {
    +
    +        void getGyroscopeRotationVectorSensorData(SensorDataSuccessCallback successCallback,
    +                                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +

    + Since: + 3.0 +

    + +
    +

    Methods

    +
    +
    +getGyroscopeRotationVectorSensorData +
    +
    +
    + Gets the current gyroscope rotation vector sensor data. You can refer to the SensorGyroscopeRotationVectorData interface. +
    +
    void getGyroscopeRotationVectorSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 3.0 +

    +
    +

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

    +

    +The ErrorCallback method is launched with these error types: +

    +
      +
    • + ServiceNotAvailableError : If the getGyroscopeRotationVectorSensorData() method is called without first calling the start() method
    • +
    • + AbortError : If the system operation was aborted
    • +
    +
    +
    +

    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 gyroscopeRotationVectorSensor = tizen.sensorservice.getDefaultSensor("GYROSCOPE_ROTATION_VECTOR");
    +
    + function onGetSuccessCB(sensorData) {
    +     console.log("######## Get the gyroscope rotation vector sensor data ########");
    +     console.log("x: " + sensorData.x);
    +     console.log("y: " + sensorData.y);
    +     console.log("z: " + sensorData.z);
    +     console.log("w: " + sensorData.w);
    + }
    +
    + function onerrorCB(error) {
    +     console.log("error occurs");
    + }
    +
    + function onsuccessCB() {
    +     console.log("sensor start");
    +     gyroscopeRotationVectorSensor.getGyroscopeRotationVectorSensorData(onGetSuccessCB, onerrorCB);
    + }
    +
    + gyroscopeRotationVectorSensor.start(onsuccessCB);
    + 
    +
    +
    +
    +
    +
    -

    2.10. SensorData

    +

    2.13. SensorData

    The SensorData interface is a common abstract interface used by different types of sensor data objects.
    @@ -1202,7 +1507,7 @@ The ErrorCallback method is launched with these error types:

    -

    2.11. SensorLightData

    +

    2.14. SensorLightData

    The SensorLightData interface represents light sensor data.
    @@ -1214,7 +1519,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Attributes

    • @@ -1230,7 +1535,7 @@ The ErrorCallback method is launched with these error types:
    -

    2.12. SensorMagneticData

    +

    2.15. SensorMagneticData

    The SensorMagneticData interface represents magnetic sensor data.
    @@ -1248,7 +1553,7 @@ The ErrorCallback method is launched with these error types: Since: 2.3

    - +

    Attributes

      @@ -1301,7 +1606,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.13. SensorPressureData

    +

    2.16. SensorPressureData

    The SensorPressureData interface represents pressure sensor data.
    @@ -1313,7 +1618,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p Since: 2.3

    - +

    Attributes

    • @@ -1329,7 +1634,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.14. SensorProximityData

    +

    2.17. SensorProximityData

    The SensorProximityData interface represents proximity sensor data.
    @@ -1341,7 +1646,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p Since: 2.3

    - +

    Attributes

    • @@ -1357,7 +1662,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.15. SensorUltravioletData

    +

    2.18. SensorUltravioletData

    The SensorUltravioletData interface represents ultraviolet sensor data.
    @@ -1369,7 +1674,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p Since: 2.3

    - +

    Attributes

    • @@ -1390,7 +1695,7 @@ The ultraviolet index is an international standard measurement of the strength o
    -

    2.16. SensorHRMRawData

    +

    2.19. SensorHRMRawData

    The SensorHRMRawData interface represents HRM sensor raw data.
    @@ -1404,7 +1709,7 @@ The ultraviolet index is an international standard measurement of the strength o Since: 2.3.1

    - +

    Attributes

      @@ -1444,10 +1749,199 @@ LED_GREEN - The green light spectrum
    +
    +

    2.20. SensorGravityData

    +
    + The SensorGravityData interface represents gravity sensor data. You can refer to this guide to learn more about gravity sensor data. +
    +
        [NoInterfaceObject] interface SensorGravityData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +

    + Since: + 3.0 +

    +

    Remark : + An example of how to access and use this interface can be found in the getGravitySensorData() code example. +

    + +
    +

    Attributes

    +
      +
    • + readonly +double x
      + Value of the Earth's gravity in the device's X axis in m/s².
      The value can be between -9.8 and 9.8 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double y
      + Value of the Earth's gravity in the device's Y axis in m/s².
      The value can be between -9.8 and 9.8 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double z
      + Value of the Earth's gravity in the device's Z axis in m/s².
      The value can be between -9.8 and 9.8 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    +
    +
    +
    +

    2.21. SensorGyroscopeData

    +
    + The SensorGyroscopeData interface represents gyroscope sensor data. You can refer to this guide to learn more about gyroscope sensor data. +
    +
        [NoInterfaceObject] interface SensorGyroscopeData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +

    + Since: + 3.0 +

    +

    Remark : + An example of how to access and use this interface can be found in the getGyroscopeSensorData() code example. +

    + +
    +

    Attributes

    +
      +
    • + readonly +double x
      + The angular velocity about the device's X axis in °/s.
      The value can be between -573.0 and 573.0 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double y
      + The angular velocity about the device's Y axis in °/s.
      The value can be between -573.0 and 573.0 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double z
      + The angular velocity about the device's Z axis in °/s.
      The value can be between -573.0 and 573.0 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    +
    +
    +
    +

    2.22. SensorGyroscopeRotationVectorData

    +
    + The SensorGyroscopeRotationVectorData interface represents gyroscope rotation vector sensor data. You can refer to this guide to learn more about gyroscope sensor data. +
    +
        [NoInterfaceObject] interface SensorGyroscopeRotationVectorData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +
    +        readonly attribute double w;
    +    };
    +

    + Since: + 3.0 +

    +
    +

    +A gyroscope rotation vector sensor data represents the orientation of the device as a combination of an angle and an axis when the device has rotated through an angle about an axis (X, Y, or Z). +It is equal to the components of a unit quaternion (cos(θ/2), x * sin(θ/2), y * sin(θ/2), z * sin(θ/2)). +

    +
    +

    Remark : + An example of how to access and use this interface can be found in the getGyroscopeRotationVectorSensorData() code example. +

    + +
    +

    Attributes

    +
      +
    • + readonly +double x
      + The X direction component of the rotation vector (x * sin(θ/2)).
      The value can be between -1 and 1 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double y
      + The Y direction component of the rotation vector (y * sin(θ/2)).
      The value can be between -1 and 1 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double z
      + The Z direction component of the rotation vector (z * sin(θ/2)).
      The value can be between -1 and 1 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    • + readonly +double w
      + The scalar component of the rotation vector (cos(θ/2)).
      The value can be between -1 and 1 inclusive. +
      +

      + Since: + 3.0 +

      +
    • +
    +
    +
    -

    2.17. SensorDataSuccessCallback

    +

    2.23. SensorDataSuccessCallback

    - The SensorDataSuccessCallback interface is a callback interface that is invoked when the sensor data has changed. For example, see the Sensor interface. + 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);
    @@ -1464,7 +1958,7 @@ LED_GREEN - The green light spectrum              
     
     
    - Called when the sensor data has changed. + Called periodically.
    void onsuccess(optional SensorData? sensorData);
                  
    @@ -1476,7 +1970,7 @@ LED_GREEN - The green light spectrum

    Parameters:

    • -sensorData [optional] [nullable]: +sensorData [optional] [nullable]: Current sensor data
    @@ -1537,13 +2031,37 @@ To guarantee that the Heart Rate Monitor application runs on a device with a hea

  • http://tizen.org/feature/sensor.heart_rate_monitor
  • +
    +

    +

    +To guarantee that the gravity sensor application runs on a device with a gravity sensor, declare the following feature requirements in the config file: +

    +

    +
  • http://tizen.org/feature/sensor.gravity
  • +
    +
    +

    +

    +To guarantee that the gyroscope sensor application runs on a device with a gyroscope sensor, declare the following feature requirements in the config file: +

    +

    +
  • http://tizen.org/feature/sensor.gyroscope
  • +
    +
    +

    +

    +To guarantee that the gyroscope rotation vector sensor application runs on a device with a gyroscope rotation vector sensor, declare the following feature requirements in the config file: +

    +

    +
  • http://tizen.org/feature/sensor.gyroscope_rotation_vector
  • +

    For more information, see Application Filtering.

    4. Full WebIDL

    module Sensor {
     
    -    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" };
    +    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };
     
         enum ProximityState { "FAR", "NEAR" };
     
    @@ -1612,6 +2130,24 @@ To guarantee that the Heart Rate Monitor application runs on a device with a hea
                                     optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    +    [NoInterfaceObject] interface GravitySensor : Sensor {
    +
    +        void getGravitySensorData(SensorDataSuccessCallback successCallback,
    +                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
    +    [NoInterfaceObject] interface GyroscopeSensor : Sensor {
    +
    +        void getGyroscopeSensorData(SensorDataSuccessCallback successCallback,
    +                                    optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
    +    [NoInterfaceObject] interface GyroscopeRotationVectorSensor : Sensor {
    +
    +        void getGyroscopeRotationVectorSensorData(SensorDataSuccessCallback successCallback,
    +                                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
         [NoInterfaceObject] interface SensorData {
          };
     
    @@ -1653,6 +2189,35 @@ To guarantee that the Heart Rate Monitor application runs on a device with a hea
             readonly attribute unsigned long lightIntensity;
         };
     
    +    [NoInterfaceObject] interface SensorGravityData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +
    +    [NoInterfaceObject] interface SensorGyroscopeData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +
    +    [NoInterfaceObject] interface SensorGyroscopeRotationVectorData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +
    +        readonly attribute double w;
    +    };
    +
         [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
             void onsuccess(optional SensorData? sensorData);
         };
    -- 
    2.7.4