From 10ebc6e560cdde8b3e72dacfb6aa93c4edc3629e Mon Sep 17 00:00:00 2001 From: Michal Kolodziej Date: Thu, 22 Sep 2016 15:40:49 +0200 Subject: [PATCH] [Sensor] Adding new sensor type [Feature] Added linear acceleration sensor Change-Id: I47d02d19e58587bf6c22b3be4a4a860f92081d60 Signed-off-by: Michal Kolodziej --- .../html/web/sensors/device_sensors_w.htm | 6 +- .../html/device_api/mobile/tizen/sensor.html | 236 ++++++++++++- .../html/device_api/wearable/tizen/sensor.html | 387 +++++++++++++++------ 3 files changed, 514 insertions(+), 115 deletions(-) diff --git a/org.tizen.guides/html/web/sensors/device_sensors_w.htm b/org.tizen.guides/html/web/sensors/device_sensors_w.htm index 41403e5..1d5d86a 100644 --- a/org.tizen.guides/html/web/sensors/device_sensors_w.htm +++ b/org.tizen.guides/html/web/sensors/device_sensors_w.htm @@ -106,6 +106,10 @@ Gyroscope rotation vector sensor in wearable applications only http://tizen.org/feature/sensor.gyroscope_rotation_vector + + + Linear acceleration sensor + http://tizen.org/feature/sensor.linear_acceleration @@ -282,4 +286,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html index 2faaaf2..0eb43b9 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html @@ -71,31 +71,35 @@ For more information about how to use Sensor API, see GyroscopeRotationVectorSensor -
  • 2.13. SensorData +
  • 2.13. LinearAccelerationSensor
  • -
  • 2.14. SensorLightData +
  • 2.14. SensorData
  • -
  • 2.15. SensorMagneticData +
  • 2.15. SensorLightData
  • -
  • 2.16. SensorPressureData +
  • 2.16. SensorMagneticData
  • -
  • 2.17. SensorProximityData +
  • 2.17. SensorPressureData
  • -
  • 2.18. SensorUltravioletData +
  • 2.18. SensorProximityData
  • -
  • 2.19. SensorHRMRawData +
  • 2.19. SensorUltravioletData
  • -
  • 2.20. SensorGravityData +
  • 2.20. SensorHRMRawData
  • -
  • 2.21. SensorGyroscopeData +
  • 2.21. SensorGravityData
  • -
  • 2.22. SensorGyroscopeRotationVectorData +
  • 2.22. SensorGyroscopeData
  • -
  • 2.23. SensorHardwareInfo +
  • 2.23. SensorGyroscopeRotationVectorData
  • -
  • 2.24. SensorDataSuccessCallback +
  • 2.24. SensorLinearAccelerationData
  • -
  • 2.25. SensorHardwareInfoSuccessCallback +
  • 2.25. SensorHardwareInfo +
  • +
  • 2.26. SensorDataSuccessCallback +
  • +
  • 2.27. SensorHardwareInfoSuccessCallback
  • @@ -172,6 +176,10 @@ For more information about how to use Sensor API, see getGyroscopeRotationVectorSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback) +LinearAccelerationSensor +
    void getLinearAccelerationSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + + SensorData @@ -212,6 +220,10 @@ For more information about how to use Sensor API, see SensorLinearAccelerationData + + + SensorHardwareInfo @@ -232,7 +244,8 @@ 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", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };
    +
        enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR",
    +                      "LINEAR_ACCELERATION" };

    Since: 2.3 @@ -260,13 +273,15 @@ GRAVITY - Gravity sensor GYROSCOPE - Gyroscope sensor

  • GYROSCOPE_ROTATION_VECTOR - Gyroscope rotation vector sensor
  • +
  • +LINEAR_ACCELERATION - Linear acceleration sensor
  • Remark : HRM_RAW is supported since Tizen 2.3.1

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

    @@ -364,6 +379,8 @@ The supported sensor types are hardware-dependent.

    To check if the given GYROSCOPE - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope")
  • GYROSCOPE_ROTATION_VECTOR - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope_rotation_vector")
  • +
  • + LINEAR_ACCELERATION - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.linear_acceleration")
  • @@ -1608,6 +1625,105 @@ The ErrorCallback method is launched with these error types:
    +
    +

    2.13. LinearAccelerationSensor

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

    + Since: + 3.0 +

    + +
    +

    Methods

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

    + Since: + 3.0 +

    +
    +

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

    +

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

    +
      +
    • + ServiceNotAvailableError : If the getLinearAccelerationSensorData() 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 linearAccelerationSensor = tizen.sensorservice.getDefaultSensor("LINEAR_ACCELERATION");
    +
    + function onGetSuccessCB(sensorData) {
    +     console.log("######## Get the linear acceleration sensor data ########");
    +     console.log("x: " + sensorData.x);
    +     console.log("y: " + sensorData.y);
    +     console.log("z: " + sensorData.z);
    + }
    +
    + function onerrorCB(error) {
    +     console.log("error occured");
    + }
    +
    + function onsuccessCB() {
    +     console.log("linear acceleration sensor start");
    +     linearAccelerationSensor.getLinearAccelerationSensorData(onGetSuccessCB, onerrorCB);
    + }
    +
    + linearAccelerationSensor.start(onsuccessCB);
    + 
    +
    +
    +

    Output example:

     linear acceleration sensor start
    + ######## Get the linear acceleration sensor data ########
    + x: 7.639427
    + y: -2.909304
    + z: -3.379018
    + 
    +
    +
    +
    +
    +

    2.13. SensorData

    @@ -2052,6 +2168,60 @@ It is equal to the components of a unit quaternion (cos(θ/2), x * sin(θ/2), y
    +
    +

    2.24. SensorLinearAccelerationData

    +
    + The SensorLinearAccelerationData interface represents linear acceleration sensor data. +
    +
        [NoInterfaceObject] interface SensorLinearAccelerationData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +

    + Since: + 3.0 +

    + +
    +

    Attributes

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

      + Since: + 3.0 +

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

      + Since: + 3.0 +

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

      + Since: + 3.0 +

      +
    • +
    +
    +

    2.23. SensorHardwareInfo

    @@ -2138,6 +2308,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)
  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • For more information about sensor, see Sensor Guide. @@ -2172,6 +2344,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)

  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • For more information about sensor, see Sensor Guide. @@ -2206,6 +2380,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)

  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • @@ -2394,13 +2570,22 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev

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

    +

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

    +

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

    For more information, see Application Filtering.

    4. Full WebIDL

    module Sensor {
     
    -    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };
    +    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR",
    +                      "LINEAR_ACCELERATION" };
     
         enum ProximityState { "FAR", "NEAR" };
     
    @@ -2489,6 +2674,12 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
                                                       optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    +    [NoInterfaceObject] interface LinearAccelerationSensor : Sensor {
    +
    +        void getLinearAccelerationSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
         [NoInterfaceObject] interface SensorData {
          };
     
    @@ -2559,6 +2750,15 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
             readonly attribute double w;
         };
     
    +    [NoInterfaceObject] interface SensorLinearAccelerationData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +
         [NoInterfaceObject] interface SensorHardwareInfo {
     
             readonly attribute DOMString name;
    @@ -2581,6 +2781,10 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
         [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
             void onsuccess(optional SensorData? sensorData);
         };
    +
    +    [Callback=FunctionOnly, NoInterfaceObject] interface SensorHardwareInfoSuccessCallback{
    +        void onsuccess(SensorHardwareInfo hardwareInfo);
    +    };
     };
    +LinearAccelerationSensor +
    void getLinearAccelerationSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + + SensorData @@ -212,6 +220,10 @@ For more information about how to use Sensor API, see SensorLinearAccelerationData + + + SensorHardwareInfo @@ -232,7 +244,8 @@ 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", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };
    +
        enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR",
    +                      "LINEAR_ACCELERATION" };

    Since: 2.3 @@ -260,13 +273,15 @@ GRAVITY - Gravity sensor GYROSCOPE - Gyroscope sensor

  • GYROSCOPE_ROTATION_VECTOR - Gyroscope rotation vector sensor
  • +
  • +LINEAR_ACCELERATION - Linear acceleration sensor
  • Remark : HRM_RAW is supported since Tizen 2.3.1

    Remark : - GRAVITY, GYROSCOPE and GYROSCOPE_ROTATION_VECTOR are supported since Tizen 2.3.2 + GRAVITY, GYROSCOPE, GYROSCOPE_ROTATION_VECTOR and LINEAR ACCELERATION are supported since Tizen 3.0

    @@ -316,9 +331,9 @@ The tizen.sensorservice object allows access to various sensors of the
        [NoInterfaceObject] interface SensorService {
     
    -        Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
    +        Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
     
    -        SensorType[] getAvailableSensors() raises(WebAPIException);
    +        SensorType[] getAvailableSensors() raises(WebAPIException);
     
         };

    @@ -364,19 +379,12 @@ The supported sensor types are hardware-dependent.

    To check if the given GYROSCOPE - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope")

  • GYROSCOPE_ROTATION_VECTOR - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.gyroscope_rotation_vector")
  • +
  • + LINEAR_ACCELERATION - tizen.systeminfo.getCapability("http://tizen.org/feature/sensor.linear_acceleration")
  • -

    - 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. -

    +
    +

    Parameters:

      @@ -839,7 +847,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -930,7 +938,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1019,7 +1027,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1108,7 +1116,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1197,7 +1205,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1302,7 +1310,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1394,7 +1402,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1493,7 +1501,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1593,7 +1601,7 @@ The ErrorCallback method is launched with these error types: } function onerrorCB(error) { - console.log("error occurs"); + console.log("error occured"); } function onsuccessCB() { @@ -1617,8 +1625,107 @@ The ErrorCallback method is launched with these error types:
    +
    +

    2.13. LinearAccelerationSensor

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

    + Since: + 3.0 +

    + +
    +

    Methods

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

    + Since: + 3.0 +

    +
    +

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

    +

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

    +
      +
    • + ServiceNotAvailableError : If the getLinearAccelerationSensorData() 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 linearAccelerationSensor = tizen.sensorservice.getDefaultSensor("LINEAR_ACCELERATION");
    +
    + function onGetSuccessCB(sensorData) {
    +     console.log("######## Get the linear acceleration sensor data ########");
    +     console.log("x: " + sensorData.x);
    +     console.log("y: " + sensorData.y);
    +     console.log("z: " + sensorData.z);
    + }
    +
    + function onerrorCB(error) {
    +     console.log("error occured");
    + }
    +
    + function onsuccessCB() {
    +     console.log("linear acceleration sensor start");
    +     linearAccelerationSensor.getLinearAccelerationSensorData(onGetSuccessCB, onerrorCB);
    + }
    +
    + linearAccelerationSensor.start(onsuccessCB);
    + 
    +
    +
    +

    Output example:

     linear acceleration sensor start
    + ######## Get the linear acceleration sensor data ########
    + x: 7.639427
    + y: -2.909304
    + z: -3.379018
    + 
    +
    +
    +
    +
    +
    -

    2.13. SensorData

    +

    2.14. SensorData

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

    -

    2.14. SensorLightData

    +

    2.15. SensorLightData

    The SensorLightData interface represents light sensor data.
    @@ -1658,7 +1765,7 @@ The ErrorCallback method is launched with these error types:
    -

    2.15. SensorMagneticData

    +

    2.16. SensorMagneticData

    The SensorMagneticData interface represents magnetic sensor data.
    @@ -1729,7 +1836,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.16. SensorPressureData

    +

    2.17. SensorPressureData

    The SensorPressureData interface represents pressure sensor data.
    @@ -1757,7 +1864,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.17. SensorProximityData

    +

    2.18. SensorProximityData

    The SensorProximityData interface represents proximity sensor data.
    @@ -1785,7 +1892,7 @@ For increasing the accuracy, wave the device around in the air in figure-eight p
    -

    2.18. SensorUltravioletData

    +

    2.19. SensorUltravioletData

    The SensorUltravioletData interface represents ultraviolet sensor data.
    @@ -1818,7 +1925,7 @@ The ultraviolet index is an international standard measurement of the strength o
    -

    2.19. SensorHRMRawData

    +

    2.20. SensorHRMRawData

    The SensorHRMRawData interface represents HRM sensor raw data.
    @@ -1873,7 +1980,7 @@ LED_GREEN - The green light spectrum
    -

    2.20. SensorGravityData

    +

    2.21. SensorGravityData

    The SensorGravityData interface represents gravity sensor data. You can refer to this guide to learn more about gravity sensor data.
    @@ -1930,7 +2037,7 @@ LED_GREEN - The green light spectrum
    -

    2.21. SensorGyroscopeData

    +

    2.22. SensorGyroscopeData

    The SensorGyroscopeData interface represents gyroscope sensor data. You can refer to this guide to learn more about gyroscope sensor data.
    @@ -1987,7 +2094,7 @@ LED_GREEN - The green light spectrum
    -

    2.22. SensorGyroscopeRotationVectorData

    +

    2.23. SensorGyroscopeRotationVectorData

    The SensorGyroscopeRotationVectorData interface represents gyroscope rotation vector sensor data. You can refer to this guide to learn more about gyroscope sensor data.
    @@ -2061,8 +2168,62 @@ It is equal to the components of a unit quaternion (cos(θ/2), x * sin(θ/2), y
    +
    +

    2.24. SensorLinearAccelerationData

    +
    + The SensorLinearAccelerationData interface represents linear acceleration sensor data. +
    +
        [NoInterfaceObject] interface SensorLinearAccelerationData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +

    + Since: + 3.0 +

    + +
    +

    Attributes

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

      + Since: + 3.0 +

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

      + Since: + 3.0 +

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

      + Since: + 3.0 +

      +
    • +
    +
    +
    -

    2.23. SensorHardwareInfo

    +

    2.25. SensorHardwareInfo

    The SensorHardwareInfo interface represents information about the sensor requested by the getSensorHardwareInfo method
    @@ -2147,6 +2308,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)
  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • For more information about sensor, see Sensor Guide. @@ -2181,6 +2344,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)

  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • For more information about sensor, see Sensor Guide. @@ -2215,6 +2380,8 @@ GRAVITY - m/s2 (meters per second squared) GYROSCOPE - °/s (Degrees/s)

  • GYROSCOPE_ROTATION_VECTOR - None
  • +
  • +LINEAR_ACCELERATION - m/s2 (meters per second squared)
  • @@ -2246,7 +2413,7 @@ GYROSCOPE_ROTATION_VECTOR - None

    -

    2.24. SensorDataSuccessCallback

    +

    2.26. SensorDataSuccessCallback

    The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
    @@ -2287,7 +2454,7 @@ GYROSCOPE_ROTATION_VECTOR - None
    -

    2.25. SensorHardwareInfoSuccessCallback

    +

    2.27. SensorHardwareInfoSuccessCallback

    The SensorHardwareInfoSuccessCallback callback interface specifies a success callback with SensorHardwareInfo object as an input argument.
    @@ -2403,13 +2570,22 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev

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

    +

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

    +

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

    For more information, see Application Filtering.

    4. Full WebIDL

    module Sensor {
     
    -    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR" };
    +    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET", "HRM_RAW", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR",
    +                      "LINEAR_ACCELERATION" };
     
         enum ProximityState { "FAR", "NEAR" };
     
    @@ -2422,91 +2598,97 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
     
         [NoInterfaceObject] interface SensorService {
     
    -        Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
    +        Sensor getDefaultSensor(SensorType type) raises(WebAPIException);
     
    -        SensorType[] getAvailableSensors() raises(WebAPIException);
    +        SensorType[] getAvailableSensors() raises(WebAPIException);
     
         };
     
         [NoInterfaceObject] interface Sensor {
     
    -        readonly attribute SensorType sensorType;
    +        readonly attribute SensorType sensorType;
     
    -        void start(SuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void start(SuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
     
    -        void stop() raises(WebAPIException);
    +        void stop() raises(WebAPIException);
     
    -        void setChangeListener(SensorDataSuccessCallback successCallback, optional long? interval, optional long batchLatency) raises(WebAPIException);
    +        void setChangeListener(SensorDataSuccessCallback successCallback, optional long? interval, optional long batchLatency) raises(WebAPIException);
     
    -        void unsetChangeListener() raises(WebAPIException);
    +        void unsetChangeListener() raises(WebAPIException);
     
    -        void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
    +         void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface LightSensor : Sensor {
    +    [NoInterfaceObject] interface LightSensor : Sensor {
     
    -        void getLightSensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getLightSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface MagneticSensor : Sensor {
    +    [NoInterfaceObject] interface MagneticSensor : Sensor {
     
    -        void getMagneticSensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getMagneticSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface PressureSensor : Sensor {
    +    [NoInterfaceObject] interface PressureSensor : Sensor {
     
    -        void getPressureSensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getPressureSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface ProximitySensor : Sensor {
    +    [NoInterfaceObject] interface ProximitySensor : Sensor {
     
    -        void getProximitySensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getProximitySensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface UltravioletSensor : Sensor {
    +    [NoInterfaceObject] interface UltravioletSensor : Sensor {
     
    -        void getUltravioletSensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getUltravioletSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface HRMRawSensor : Sensor {
    +    [NoInterfaceObject] interface HRMRawSensor : Sensor {
     
    -        void getHRMRawSensorData(SensorDataSuccessCallback successCallback,
    -                                optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getHRMRawSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface GravitySensor : Sensor {
    +    [NoInterfaceObject] interface GravitySensor : Sensor {
     
    -        void getGravitySensorData(SensorDataSuccessCallback successCallback,
    -                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getGravitySensorData(SensorDataSuccessCallback successCallback,
    +                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface GyroscopeSensor : Sensor {
    +    [NoInterfaceObject] interface GyroscopeSensor : Sensor {
     
    -        void getGyroscopeSensorData(SensorDataSuccessCallback successCallback,
    -                                    optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getGyroscopeSensorData(SensorDataSuccessCallback successCallback,
    +                                    optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
    -    [NoInterfaceObject] interface GyroscopeRotationVectorSensor : Sensor {
    +    [NoInterfaceObject] interface GyroscopeRotationVectorSensor : Sensor {
     
    -        void getGyroscopeRotationVectorSensorData(SensorDataSuccessCallback successCallback,
    -                                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void getGyroscopeRotationVectorSensorData(SensorDataSuccessCallback successCallback,
    +                                                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
    +    [NoInterfaceObject] interface LinearAccelerationSensor : Sensor {
    +
    +        void getLinearAccelerationSensorData(SensorDataSuccessCallback successCallback,
    +                                optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
     
         [NoInterfaceObject] interface SensorData {
          };
     
    -    [NoInterfaceObject] interface SensorLightData : SensorData {
    +    [NoInterfaceObject] interface SensorLightData : SensorData {
     
             readonly attribute double lightLevel;
         };
     
    -    [NoInterfaceObject] interface SensorMagneticData : SensorData {
    +    [NoInterfaceObject] interface SensorMagneticData : SensorData {
     
             readonly attribute double x;
     
    @@ -2514,32 +2696,32 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
     
             readonly attribute double z;
     
    -        readonly attribute MagneticSensorAccuracy accuracy;
    +        readonly attribute MagneticSensorAccuracy accuracy;
         };
     
    -    [NoInterfaceObject] interface SensorPressureData : SensorData {
    +    [NoInterfaceObject] interface SensorPressureData : SensorData {
     
             readonly attribute double pressure;
         };
     
    -    [NoInterfaceObject] interface SensorProximityData : SensorData {
    +    [NoInterfaceObject] interface SensorProximityData : SensorData {
     
    -        readonly attribute ProximityState proximityState;
    +        readonly attribute ProximityState proximityState;
         };
     
    -    [NoInterfaceObject] interface SensorUltravioletData : SensorData {
    +    [NoInterfaceObject] interface SensorUltravioletData : SensorData {
     
             readonly attribute long ultravioletLevel;
         };
     
    -    [NoInterfaceObject] interface SensorHRMRawData : SensorData {
    +    [NoInterfaceObject] interface SensorHRMRawData : SensorData {
     
             readonly attribute DOMString lightType;
     
             readonly attribute unsigned long lightIntensity;
         };
     
    -    [NoInterfaceObject] interface SensorGravityData : SensorData {
    +    [NoInterfaceObject] interface SensorGravityData : SensorData {
     
             readonly attribute double x;
     
    @@ -2548,7 +2730,7 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
             readonly attribute double z;
         };
     
    -    [NoInterfaceObject] interface SensorGyroscopeData : SensorData {
    +    [NoInterfaceObject] interface SensorGyroscopeData : SensorData {
     
             readonly attribute double x;
     
    @@ -2557,7 +2739,7 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
             readonly attribute double z;
         };
     
    -    [NoInterfaceObject] interface SensorGyroscopeRotationVectorData : SensorData {
    +    [NoInterfaceObject] interface SensorGyroscopeRotationVectorData : SensorData {
     
             readonly attribute double x;
     
    @@ -2568,6 +2750,15 @@ To guarantee that the gyroscope rotation vector sensor application runs on a dev
             readonly attribute double w;
         };
     
    +    [NoInterfaceObject] interface SensorLinearAccelerationData : SensorData {
    +
    +        readonly attribute double x;
    +
    +        readonly attribute double y;
    +
    +        readonly attribute double z;
    +    };
    +
         [NoInterfaceObject] interface SensorHardwareInfo {
     
             readonly attribute DOMString name;
    -- 
    2.7.4