</dt>
<dd>
<div class="brief">
- Registers a change listener to be called when sensor data of the given type changes.
+Registers a change 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);
</pre></div>
The start() method must be called to turn on the sensor, or the sensor data will not change.
</p>
</div>
+<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 2.3.2</p>
<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 the sensor data changes
+ Callback method to be invoked periodically.
</li>
<li class="param">
- <span class="name">interval</span> <span class="optional">[optional]</span>:
- The period in milliseconds at which events are invoked. Valid values are integers in range <10, 1000> inclusively. The default value is 100.
+ <span class="name">interval</span>
+ <span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The period in milliseconds at which sensor data will be sent to the application which calls this method.<br />
+ <em>interval</em> should be in range <10, 1000> inclusively. However, if it is null or zero, it will be set to the default value of 100 ms.<br />
+For the <a href="#SensorType">PROXIMITY</a> sensor type,<em> interval</em> will be ignored.
</li>
</ul>
</div>
<li class="list"><p>
with error type UnknownError, if registering the listener fails because of an unknown error.
</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>
The start() method must be called to turn on the sensor, or the sensor data will not change.
</p>
</div>
+<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 2.3.2</p>
<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 the sensor data changes
+ Callback method to be invoked periodically.
</li>
<li class="param">
-<span class="name">interval</span> <span class="optional">[optional]</span>:
-The period in milliseconds at which events are invoked. Valid values are integers in range <10, 1000> inclusively. The default value is 100.
+<span class="name">interval</span>
+<span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+The period in milliseconds at which sensor data will be sent to the application which calls this method.<br />
+ <em>interval</em> should be in range <10, 1000> inclusively. However, if it is null or zero, it will be set to the default value of 100 ms.<br />
+For the <a href="#SensorType">PROXIMITY</a> sensor type,<em> interval</em> will be ignored.
</li>
</ul>
</div>
<li class="list"><p>
with error type UnknownError, if registering the listener fails because of an unknown error.
</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">
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
var proximitySensor = tizen.sensorservice.getDefaultSensor("PROXIMITY");
function onsuccessCB() {
lightSensor.start(onSuccessCB);
</pre>
</div>
-
</dd>
<dt class="method" id="Sensor::unsetChangeListener">
<a class="backward-compatibility-anchor" name="::Sensor::Sensor::unsetChangeListener"></a><code><b><span class="methodName">unsetChangeListener</span></b></code>