</li>
<li>2.22. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
</li>
-<li>2.23. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+<li>2.23. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+</li>
+<li>2.24. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+</li>
+<li>2.25. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
</li>
</ul>
</li>
<td>
<div>void <a href="#Sensor::start">start</a> (<a href="tizen.html#SuccessCallback">SuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div>
<div>void <a href="#Sensor::stop">stop</a> ()</div>
-<div>void <a href="#Sensor::setChangeListener">setChangeListener</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval)</div>
+<div>void <a href="#Sensor::setChangeListener">setChangeListener</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency)</div>
<div>void <a href="#Sensor::unsetChangeListener">unsetChangeListener</a> ()</div>
+<div>void <a href="#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> (<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
+<td><a href="#SensorHardwareInfo">SensorHardwareInfo</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a></td>
<td><div>void <a href="#SensorDataSuccessCallback::onsuccess">onsuccess</a> (optional <a href="#SensorData">SensorData</a>? sensorData)</div></td>
</tr>
+<tr>
+<td><a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a></td>
+<td><div>void <a href="#SensorHardwareInfoSuccessCallback::onsuccess">onsuccess</a> (<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo)</div></td>
+</tr>
</tbody>
</table>
<div class="typedefs" id="typedefs-section">
GYROSCOPE_ROTATION_VECTOR - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.gyroscope_rotation_vector"</em>) </li>
</ul>
</div>
-<p><span class="privilegelevel">
- Privilege level: </span>
- public
- </p>
-<p><span class="privilege">
- Privilege: </span>
- http://tizen.org/privilege/healthinfo
- </p>
-<p><span class="remark"> Remark : </span>
- <b>http://tizen.org/privilege/healthinfo</b> is required only for <a href="#SensorType">HRM_RAW </a> type. <em>HRM_RAW</em> is supported since Tizen 2.3.1.
- </p>
+<div class="description">
+ </div>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">type</span>:
+<span class="name">type</span>:
Sensor type to access
- </li>
+ <ul>
+<b>Conditional privilege: </b>For using <a href="#SensorType">HRM_RAW</a> value, privilege <b>
+ http://tizen.org/privilege/healthinfo
+ (public level)</b> is needed since Tizen 2.3.1.</ul>
+</li>
</ul>
</div>
<div class="returntype">
void stop() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
- void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getSensorHardwareInfo(<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
Since: </span>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when sensor has been successfully started
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
<div class="brief">
Registers a listener to retrieve sensor data periodically.
</div>
-<div class="synopsis"><pre class="signature prettyprint">void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval);
+<div class="synopsis"><pre class="signature prettyprint">void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency);
</pre></div>
<p><span class="version">
Since: </span>
</p>
</div>
<p><span class="remark"> Remark : </span>
- <em>interval</em> is supported since Tizen 3.0
+ <em>interval</em>, <em>batchLatency</em> are supported since Tizen 3.0
</p>
<p><span class="remark"> Remark : </span>
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.
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked periodically.
</li>
<li class="param">
-<span class="name">interval</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">interval</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
The interval in milliseconds (ms) at which sensor data will be sent to the Web Application which calls this method since Tizen 3.0<br><em>interval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set to the default value of 100ms.<br>For the <a href="#SensorType">PROXIMITY</a> sensor type, <em>interval</em> will be ignored.
</li>
+ <li class="param">
+<span class="name">batchLatency</span><span class="optional"> [optional]</span>:
+ The batch latency time in milliseconds (ms) at which sensor events are stored or delivered when processor stay on sleep or suspend status since Tizen 3.0<br><em>batchLatency</em> has hardware dependency. You can calculate maximum batchLatency value using <a href="#SensorHardwareInfo">maxBatchCount</a> (e.g. interval x maxBatchCount) . If maxBatchCount is zero, device doesn't support batch latency time.
+ </li>
</ul>
</div>
<div class="exceptionlist">
with error type UnknownError, if registering the listener fails because of an unknown error.
</p></li>
<li class="list"><p>
+ with error type NotSupportedError, if the batchLatency is not supported on the sensor hardware.
+ </p></li>
+<li class="list"><p>
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
</p></li>
</ul>
</li></ul>
</div>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");
function onsuccessCB() {
- console.log("proximity sensor start");
+ console.log("light sensor start");
}
function onchangedCB(sensorData) {
- console.log("proximity distance : " + sensorData.proximityState);
+ console.log("light level: " + sensorData.lightLevel);
}
- // interval can be ommitted.
- proximitySensor.setChangeListener(onchangedCB, 200);
+ // interval and batchLatency can be ommitted.
+ lightSensor.setChangeListener(onchangedCB, 200, 2000);
- proximitySensor.start(onsuccessCB);
+ lightSensor.start(onsuccessCB);
</pre>
</div>
</dd>
</pre>
</div>
</dd>
+<dt class="method" id="Sensor::getSensorHardwareInfo">
+<a class="backward-compatibility-anchor" name="::Sensor::Sensor::getSensorHardwareInfo"></a><code><b><span class="methodName">getSensorHardwareInfo</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets hardware information of the sensor.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getSensorHardwareInfo(<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+<div class="description">
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+AbortError - If operation failed. </li>
+ <li>
+IOError - If the platform fails to internally prepare a socket for IPC communication. </li>
+ </ul>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback method to be invoked when sensor has been successfully gotten hardware information.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback method to be invoked when an error occurs.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var gravitySensor = tizen.sensorservice.getDefaultSensor("GRAVITY");
+ gravitySensor.getSensorHardwareInfo(onsuccessCB);
+
+ function onsuccessCB(hardwareInfo){
+ console.log("name: " + hardwareInfo.name);
+ console.log("type: " + hardwareInfo.type);
+ console.log("vendor: " + hardwareInfo.vendor);
+ console.log("minValue: " + hardwareInfo.minValue);
+ console.log("maxValue: " + hardwareInfo.maxValue);
+ console.log("resolution: " + hardwareInfo.resolution);
+ console.log("minInterval: " + hardwareInfo.minInterval);
+ console.log("maxBatchCount: " + hardwareInfo.maxBatchCount);
+ }
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> name: Gravity Sensor
+ type: GRAVITY
+ vendor: Samsung Electronics
+ minValue: -19.6
+ maxValue: 19.6
+ resolution: 0.01
+ minInterval: 1
+ maxBatchCount: 0
+ </pre>
+</div>
+</dd>
</dl>
</div>
</div>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3.1
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
3.0
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gravitySensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gravity sensor data ########
+ x: -0.477486
+ y: -0.132515
+ z: -9.794124
+ </pre>
+</div>
</dd>
</dl>
</div>
Since: </span>
3.0
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gyroscopeSensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gyroscope sensor data ########
+ x: 186
+ y: -296
+ z: -113
+ </pre>
+</div>
</dd>
</dl>
</div>
Since: </span>
3.0
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gyroscopeRotationVectorSensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gyroscope rotation vector sensor data ########
+ x: 0
+ y: 0
+ z: 0
+ w: 0
+ </pre>
+</div>
</dd>
</dl>
</div>
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorLightData::lightLevel">
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorPressureData::pressure">
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorProximityData::proximityState">
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorUltravioletData::ultravioletLevel">
Since: </span>
2.3.1
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GravitySensor::getGravitySensorData">getGravitySensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GyroscopeSensor::getGyroscopeSensorData">getGyroscopeSensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GyroscopeRotationVectorSensor::getGyroscopeRotationVectorSensorData">getGyroscopeRotationVectorSensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
</ul>
</div>
</div>
+<div class="interface" id="SensorHardwareInfo">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.23. SensorHardwareInfo</h3>
+<div class="brief">
+ The SensorHardwareInfo interface represents information about the sensor requested by the <a href="sensor.html#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> method
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SensorHardwareInfo {
+
+ readonly attribute DOMString name;
+
+ readonly attribute <a href="#SensorType">SensorType</a> type;
+
+ readonly attribute DOMString vendor;
+
+ readonly attribute double minValue;
+
+ readonly attribute double maxValue;
+
+ readonly attribute double resolution;
+
+ readonly attribute long minInterval;
+
+ readonly attribute long maxBatchCount;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+<p><span class="remark"> Remark : </span>
+ This interface returns hardware information provided by the sensor manufacture.
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SensorHardwareInfo::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">name</span></span><div class="brief">
+ Name of the sensor.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::type">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">SensorType </span><span class="name">type</span></span><div class="brief">
+ <a href="sensor.html#SensorType">Type of the sensor</a>.<br> </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::vendor">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">vendor</span></span><div class="brief">
+ Vendor of the sensor.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::minValue">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">minValue</span></span><div class="brief">
+ Minimum reading value that can be received from the sensor.<br><br>The units for the minimum value depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/dev-guide/latest/org.tizen.guides/html/native/system/sensors_n.htm">Sensor Guide</a>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::maxValue">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">maxValue</span></span><div class="brief">
+ Maximum reading value that can be received from the sensor.<br><br>The units for the maximum value depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/dev-guide/latest/org.tizen.guides/html/native/system/sensors_n.htm">Sensor Guide</a>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::resolution">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">resolution</span></span><div class="brief">
+ The smallest change which the sensor can detect.<br><br>The units of the resolution depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::minInterval">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">minInterval</span></span><div class="brief">
+ Minimum interval of the sensor which means a period between two events.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::maxBatchCount">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">maxBatchCount</span></span><div class="brief">
+ Maximum batch count of sensor, batch means storing a sensors event in a hardware FIFO register when processor stay on sleep or suspend status.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="SensorDataSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.23. SensorDataSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.24. SensorDataSuccessCallback</h3>
<div class="brief">
The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
</div>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">sensorData</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">sensorData</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Current sensor data
</li>
</ul>
</dl>
</div>
</div>
+<div class="interface" id="SensorHardwareInfoSuccessCallback">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.25. SensorHardwareInfoSuccessCallback</h3>
+<div class="brief">
+ The SensorHardwareInfoSuccessCallback callback interface specifies a success callback with SensorHardwareInfo object as an input argument.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface SensorHardwareInfoSuccessCallback{
+ void onsuccess(<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="SensorHardwareInfoSuccessCallback::onsuccess">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback::onsuccess"></a><code><b><span class="methodName">onsuccess</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when sensor hardware infomation is successfully retrieved.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onsuccess(<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 3.0
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">hardwareInfo</span>:
+ Current sensor Hardware Info
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
</div>
<h2 id="api-features">3. Related Feature</h2>
<div id="def-api-features" class="def-api-features">
void stop() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
- void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
[NoInterfaceObject] interface LightSensor : <a href="#Sensor">Sensor</a> {
readonly attribute double w;
};
+ [NoInterfaceObject] interface SensorHardwareInfo {
+
+ readonly attribute DOMString name;
+
+ readonly attribute SensorType type;
+
+ readonly attribute DOMString vendor;
+
+ readonly attribute double minValue;
+
+ readonly attribute double maxValue;
+
+ readonly attribute double resolution;
+
+ readonly attribute long minInterval;
+
+ readonly attribute long maxBatchCount;
+ };
+
[Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
void onsuccess(optional <a href="#SensorData">SensorData</a>? sensorData);
};
</li>
<li>2.22. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
</li>
-<li>2.23. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+<li>2.23. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+</li>
+<li>2.24. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+</li>
+<li>2.25. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
</li>
</ul>
</li>
<td>
<div>void <a href="#Sensor::start">start</a> (<a href="tizen.html#SuccessCallback">SuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div>
<div>void <a href="#Sensor::stop">stop</a> ()</div>
-<div>void <a href="#Sensor::setChangeListener">setChangeListener</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval)</div>
+<div>void <a href="#Sensor::setChangeListener">setChangeListener</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency)</div>
<div>void <a href="#Sensor::unsetChangeListener">unsetChangeListener</a> ()</div>
+<div>void <a href="#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> (<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
+<td><a href="#SensorHardwareInfo">SensorHardwareInfo</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a></td>
<td><div>void <a href="#SensorDataSuccessCallback::onsuccess">onsuccess</a> (optional <a href="#SensorData">SensorData</a>? sensorData)</div></td>
</tr>
+<tr>
+<td><a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a></td>
+<td><div>void <a href="#SensorHardwareInfoSuccessCallback::onsuccess">onsuccess</a> (<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo)</div></td>
+</tr>
</tbody>
</table>
<div class="typedefs" id="typedefs-section">
<em>HRM_RAW</em> is supported since Tizen 2.3.1
</p>
<p><span class="remark"> Remark : </span>
- <em>GRAVITY</em>, <em>GYROSCOPE</em> and <em>GYROSCOPE_ROTATION_VECTOR</em> are supported since Tizen 3.0
+ <em>GRAVITY</em>, <em>GYROSCOPE</em> and <em>GYROSCOPE_ROTATION_VECTOR</em> are supported since Tizen 2.3.2
</p>
</div>
<div class="enum" id="ProximityState">
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">type</span>:
+<span class="name">type</span>:
Sensor type to access
- </li>
+ <ul>
+<b>Conditional privilege: </b>For using <a href="#SensorType">HRM_RAW</a> value, privilege <b>
+ http://tizen.org/privilege/healthinfo
+ (public level)</b> is needed since Tizen 2.3.1.</ul>
+</li>
</ul>
</div>
<div class="returntype">
void stop() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
- void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getSensorHardwareInfo(<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
Since: </span>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when sensor has been successfully started
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
<div class="brief">
Registers a listener to retrieve sensor data periodically.
</div>
-<div class="synopsis"><pre class="signature prettyprint">void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval);
+<div class="synopsis"><pre class="signature prettyprint">void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency);
</pre></div>
<p><span class="version">
Since: </span>
</p>
</div>
<p><span class="remark"> Remark : </span>
- <em>interval</em> is supported since Tizen 3.0
+ <em>interval</em>, <em>batchLatency</em> are supported since Tizen 2.3.2
</p>
<p><span class="remark"> Remark : </span>
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.
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked periodically.
</li>
<li class="param">
-<span class="name">interval</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
- The interval in milliseconds (ms) at which sensor data will be sent to the Web Application which calls this method since Tizen 3.0<br><em>interval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set to the default value of 100ms.<br>For the <a href="#SensorType">PROXIMITY</a> sensor type, <em>interval</em> will be ignored.
+<span class="name">interval</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The interval in milliseconds (ms) at which sensor data will be sent to the Web Application which calls this method since Tizen 2.3.2<br><em>interval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set to the default value of 100ms.<br>For the <a href="#SensorType">PROXIMITY</a> sensor type, <em>interval</em> will be ignored.
+ </li>
+ <li class="param">
+<span class="name">batchLatency</span><span class="optional"> [optional]</span>:
+ The batch latency time in milliseconds (ms) at which sensor events are stored or delivered when processor stay on sleep or suspend status since Tizen 2.3.2<br><em>batchLatency</em> has hardware dependency. You can calculate maximum batchLatency value using <a href="#SensorHardwareInfo">maxBatchCount</a> (e.g. interval x maxBatchCount) . If maxBatchCount is zero, device doesn't support batch latency time.
</li>
</ul>
</div>
with error type UnknownError, if registering the listener fails because of an unknown error.
</p></li>
<li class="list"><p>
+ with error type NotSupportedError, if the batchLatency is not supported on the sensor hardware.
+ </p></li>
+<li class="list"><p>
with error type InvalidValuesError, if any of the input parameters contain an invalid value.
</p></li>
</ul>
</li></ul>
</div>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var lightSensor = tizen.sensorservice.getDefaultSensor("LIGHT");
function onsuccessCB() {
- console.log("proximity sensor start");
+ console.log("light sensor start");
}
function onchangedCB(sensorData) {
- console.log("proximity distance : " + sensorData.proximityState);
+ console.log("light level: " + sensorData.lightLevel);
}
- // interval can be ommitted.
- proximitySensor.setChangeListener(onchangedCB, 200);
+ // interval and batchLatency can be ommitted.
+ lightSensor.setChangeListener(onchangedCB, 200, 2000);
- proximitySensor.start(onsuccessCB);
+ lightSensor.start(onsuccessCB);
</pre>
</div>
</dd>
</pre>
</div>
</dd>
+<dt class="method" id="Sensor::getSensorHardwareInfo">
+<a class="backward-compatibility-anchor" name="::Sensor::Sensor::getSensorHardwareInfo"></a><code><b><span class="methodName">getSensorHardwareInfo</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets hardware information of the sensor.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getSensorHardwareInfo(<a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+<div class="description">
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+AbortError - If operation failed. </li>
+ <li>
+IOError - If the platform fails to internally prepare a socket for IPC communication. </li>
+ </ul>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback method to be invoked when sensor has been successfully gotten hardware information.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback method to be invoked when an error occurs.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var gravitySensor = tizen.sensorservice.getDefaultSensor("GRAVITY");
+ gravitySensor.getSensorHardwareInfo(onsuccessCB);
+
+ function onsuccessCB(hardwareInfo){
+ console.log("name: " + hardwareInfo.name);
+ console.log("type: " + hardwareInfo.type);
+ console.log("vendor: " + hardwareInfo.vendor);
+ console.log("minValue: " + hardwareInfo.minValue);
+ console.log("maxValue: " + hardwareInfo.maxValue);
+ console.log("resolution: " + hardwareInfo.resolution);
+ console.log("minInterval: " + hardwareInfo.minInterval);
+ console.log("maxBatchCount: " + hardwareInfo.maxBatchCount);
+ }
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> name: Gravity Sensor
+ type: GRAVITY
+ vendor: Samsung Electronics
+ minValue: -19.6
+ maxValue: 19.6
+ resolution: 0.01
+ minInterval: 1
+ maxBatchCount: 0
+ </pre>
+</div>
+</dd>
</dl>
</div>
</div>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
Since: </span>
2.3.1
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
</pre></div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<div class="description">
<p>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gravitySensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gravity sensor data ########
+ x: -0.477486
+ y: -0.132515
+ z: -9.794124
+ </pre>
+</div>
</dd>
</dl>
</div>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
</pre></div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<div class="description">
<p>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gyroscopeSensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gyroscope sensor data ########
+ x: 186
+ y: -296
+ z: -113
+ </pre>
+</div>
</dd>
</dl>
</div>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
-
+
<div class="methods">
<h4>Methods</h4>
<dl>
</pre></div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<div class="description">
<p>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">successCallback</span>:
+<span class="name">successCallback</span>:
Callback method to be invoked when the sensor data has been read
</li>
<li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Callback method to be invoked when an error occurs
</li>
</ul>
gyroscopeRotationVectorSensor.start(onsuccessCB);
</pre>
</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> sensor start
+ ######## Get the gyroscope rotation vector sensor data ########
+ x: 0
+ y: 0
+ z: 0
+ w: 0
+ </pre>
+</div>
</dd>
</dl>
</div>
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorLightData::lightLevel">
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorPressureData::pressure">
<span class="attrName"><span class="readonly"> readonly
</span><span class="type">double </span><span class="name">pressure</span></span><div class="brief">
- Pressure in millibar (hPa).
+ Pressure in hectopascal (hPa).
</div>
<p><span class="version">
Since: </span>
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorProximityData::proximityState">
Since: </span>
2.3
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul><li class="attribute" id="SensorUltravioletData::ultravioletLevel">
Since: </span>
2.3.1
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GravitySensor::getGravitySensorData">getGravitySensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGravityData::y">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGravityData::z">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
</ul>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GyroscopeSensor::getGyroscopeSensorData">getGyroscopeSensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGyroscopeData::y">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGyroscopeData::z">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
</ul>
};</pre>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
<div class="description">
<p>
<p><span class="remark"> Remark : </span>
An example of how to access and use this interface can be found in the <a href="sensor.html#GyroscopeRotationVectorSensor::getGyroscopeRotationVectorSensorData">getGyroscopeRotationVectorSensorData()</a> code example.
</p>
-
+
<div class="attributes">
<h4>Attributes</h4>
<ul>
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGyroscopeRotationVectorData::y">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGyroscopeRotationVectorData::z">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
</p>
</li>
<li class="attribute" id="SensorGyroscopeRotationVectorData::w">
</div>
<p><span class="version">
Since: </span>
- 3.0
+ 2.3.2
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="SensorHardwareInfo">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.23. SensorHardwareInfo</h3>
+<div class="brief">
+ The SensorHardwareInfo interface represents information about the sensor requested by the <a href="sensor.html#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> method
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SensorHardwareInfo {
+
+ readonly attribute DOMString name;
+
+ readonly attribute <a href="#SensorType">SensorType</a> type;
+
+ readonly attribute DOMString vendor;
+
+ readonly attribute double minValue;
+
+ readonly attribute double maxValue;
+
+ readonly attribute double resolution;
+
+ readonly attribute long minInterval;
+
+ readonly attribute long maxBatchCount;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+<p><span class="remark"> Remark : </span>
+ This interface returns hardware information provided by the sensor manufacture.
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SensorHardwareInfo::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">name</span></span><div class="brief">
+ Name of the sensor.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::type">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">SensorType </span><span class="name">type</span></span><div class="brief">
+ <a href="sensor.html#SensorType">Type of the sensor</a>.<br> </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::vendor">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">vendor</span></span><div class="brief">
+ Vendor of the sensor.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::minValue">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">minValue</span></span><div class="brief">
+ Minimum reading value that can be received from the sensor.<br><br>The units for the minimum value depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/dev-guide/latest/org.tizen.guides/html/native/system/sensors_n.htm">Sensor Guide</a>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::maxValue">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">maxValue</span></span><div class="brief">
+ Maximum reading value that can be received from the sensor.<br><br>The units for the maximum value depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/dev-guide/latest/org.tizen.guides/html/native/system/sensors_n.htm">Sensor Guide</a>.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::resolution">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">resolution</span></span><div class="brief">
+ The smallest change which the sensor can detect.<br><br>The units of the resolution depends on the sensor type:<br> </div>
+<div class="description">
+ <ul>
+ <li>
+LIGHT - lux </li>
+ <li>
+MAGNETIC - μT (micro Tesla) </li>
+ <li>
+PRESSURE - hPa (hectopascal) </li>
+ <li>
+PROXIMITY - None </li>
+ <li>
+ULTRAVIOLET - UV index (ultraviolet index) </li>
+ <li>
+HRM_RAW - None </li>
+ <li>
+GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
+GYROSCOPE - °/s (Degrees/s) </li>
+ <li>
+GYROSCOPE_ROTATION_VECTOR - None </li>
+ </ul>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::minInterval">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">minInterval</span></span><div class="brief">
+ Minimum interval of the sensor which means a period between two events.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+</li>
+<li class="attribute" id="SensorHardwareInfo::maxBatchCount">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">maxBatchCount</span></span><div class="brief">
+ Maximum batch count of sensor, batch means storing a sensors event in a hardware FIFO register when processor stay on sleep or suspend status.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
</p>
</li>
</ul>
</div>
</div>
<div class="interface" id="SensorDataSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.23. SensorDataSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.24. SensorDataSuccessCallback</h3>
<div class="brief">
The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
</div>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">sensorData</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+<span class="name">sensorData</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
Current sensor data
</li>
</ul>
</dl>
</div>
</div>
+<div class="interface" id="SensorHardwareInfoSuccessCallback">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.25. SensorHardwareInfoSuccessCallback</h3>
+<div class="brief">
+ The SensorHardwareInfoSuccessCallback callback interface specifies a success callback with SensorHardwareInfo object as an input argument.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface SensorHardwareInfoSuccessCallback{
+ void onsuccess(<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="SensorHardwareInfoSuccessCallback::onsuccess">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback::onsuccess"></a><code><b><span class="methodName">onsuccess</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when sensor hardware infomation is successfully retrieved.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onsuccess(<a href="#SensorHardwareInfo">SensorHardwareInfo</a> hardwareInfo);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.2
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">hardwareInfo</span>:
+ Current sensor Hardware Info
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
</div>
<h2 id="api-features">3. Related Feature</h2>
<div id="def-api-features" class="def-api-features">
void stop() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
- void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void setChangeListener(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional long? interval, optional long batchLatency) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
[NoInterfaceObject] interface LightSensor : <a href="#Sensor">Sensor</a> {
readonly attribute double w;
};
+ [NoInterfaceObject] interface SensorHardwareInfo {
+
+ readonly attribute DOMString name;
+
+ readonly attribute SensorType type;
+
+ readonly attribute DOMString vendor;
+
+ readonly attribute double minValue;
+
+ readonly attribute double maxValue;
+
+ readonly attribute double resolution;
+
+ readonly attribute long minInterval;
+
+ readonly attribute long maxBatchCount;
+ };
+
[Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
- void onsuccess(optional <a href="#SensorData">SensorData</a>? sensorData);
+ void onsuccess(optional SensorData? sensorData);
+ };
+
+ [Callback=FunctionOnly, NoInterfaceObject] interface SensorHardwareInfoSuccessCallback{
+ void onsuccess(SensorHardwareInfo hardwareInfo);
};
};</pre>
</div>