[WebDeviceAPI] update guide, tutorial and reference for HAM, Sensor
authortaekeun.kang <taekeun.kang@samsung.com>
Wed, 2 Mar 2016 01:01:10 +0000 (10:01 +0900)
committertaekeun.kang <taekeun.kang@samsung.com>
Wed, 2 Mar 2016 01:39:18 +0000 (10:39 +0900)
Change-Id: I2a783650cd5c8765206b56c987147590ff70ab30
Signed-off-by: taekeun.kang <taekeun.kang@samsung.com>
org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm
org.tizen.tutorials/html/web/tizen/system/sensor_tutorial_w.htm
org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html
org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html
org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html
org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html

index fa390eb..84ca19e 100644 (file)
@@ -86,6 +86,22 @@ tizen.humanactivitymonitor.start(&quot;HRM&quot;, onchangedCB);</pre>
 }
 
 tizen.humanactivitymonitor.start(&quot;WRIST_UP&quot;, onchangedCB)</pre>
+
+<p>If a human activity type allows setting the interval at which data is sent to the application or setting the sampling interval, the last parameter of the <span style="font-family: Courier New,Courier,monospace">start()</span> method, option, can be used to specify this information:</p>
+
+<pre class="prettyprint">var myCallbackInterval = 240000;
+var mySampleInterval = 10000;
+
+function onchangedCB(gpsInfo)
+{
+&nbsp;&nbsp;&nbsp;console.log(&quot;this callback will be called every &quot; + myCallbackInterval + &quot; milliseconds&quot;);
+&nbsp;&nbsp;&nbsp;console.log(&quot;the gpsInfo will include the information of the GPS that is collected every &quot; + mySampleInterval + &quot; millisenconds&quot;);
+}
+
+var option = {&quot;callbackInterval&quot;: myCallbackInterval,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sampleInterval&quot;: mySampleInterval};
+};
+tizen.humanactivitymonitor.start(&quot;GPS&quot;, onchangedCB, option);</pre>
 </li>
 
 <li>When the a heart-rate monitor (HRM) is enabled, you can get the current data using the <span style="font-family: Courier New,Courier,monospace">getHumanActivityData()</span> method of the <span style="font-family: Courier New,Courier,monospace">HumanActivityMonitorManager</span> interface:
index fb3ae96..a1606b5 100644 (file)
@@ -123,28 +123,28 @@ lightSensor.start(onsuccessCB);
 <li>Define an event handler for sensor data changes by implementing the <span style="font-family: Courier New,Courier,monospace">SensorDataSuccessCallback</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html#SensorDataSuccessCallback">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html#SensorDataSuccessCallback">wearable</a> applications):
 <pre class="prettyprint">function onchangedCB(sensorData)
 {
-&nbsp;&nbsp;&nbsp;console.log(&quot;value of pressure is: &quot; + sensorData.pressure);
+&nbsp;&nbsp;&nbsp;console.log(&quot;Light sensor data: &quot; + sensorData.lightLevel);
 }
 </pre>
 </li>
 
 <li>Register a change listener to be called when the sensor data changes.
-<p>To register a  change listener, use the <span style="font-family: Courier New,Courier,monospace">setChangeListener()</span> method of the <span style="font-family: Courier New,Courier,monospace">Sensor</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html#Sensor">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html#Sensor">wearable</a> applications).</p>
+<p>To register a change listener, use the <span style="font-family: Courier New,Courier,monospace">setChangeListener()</span> method of the <span style="font-family: Courier New,Courier,monospace">Sensor</span> interface (in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html#Sensor">mobile</a> and <a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html#Sensor">wearable</a> applications).</p>
 <p>This command requires two parameters. The first one is a handle to the callback method, which will be invoked for every incoming event. The second argument determines the amount of time (in milliseconds) passing between two consecutive events. Valid values are integers in range &lt;10, 1000&gt; inclusively. For example, setting an <span style="font-family: Courier New,Courier,monospace">interval</span> to 100 results in approximately 10 events being send every second.</p>
-<pre class="prettyprint">var proximitySensor = tizen.sensorservice.getDefaultSensor(&quot;PROXIMITY&quot;);
+<pre class="prettyprint">var lightSensor = tizen.sensorservice.getDefaultSensor(&quot;LIGHT&quot;);
 
 function onsuccessCB()
 {
-&nbsp;&nbsp;&nbsp;console.log(&quot;proximity sensor start&quot;);
+&nbsp;&nbsp;&nbsp;console.log(&quot;Light sensor service has started successfully.&quot;);
 }
 
 function onchangedCB(sensorData)
 {
-&nbsp;&nbsp;&nbsp;console.log(&quot;proximity distance: &quot; + sensorData.proximityState);
+&nbsp;&nbsp;&nbsp;console.log(&quot;Light sensor data: &quot; + sensorData.lightLevel);
 }
 
-proximitySensor.setChangeListener(onchangedCB, 500);
-proximitySensor.start(onsuccessCB);</pre>
+lightSensor.setChangeListener(onchangedCB, 500);
+lightSensor.start(onsuccessCB);</pre>
 The default value of <span style="font-family: Courier New,Courier,monospace">interval</span> parameter is 100. If you do not pass an <span style="font-family: Courier New,Courier,monospace">interval</span> value, a default one will be used:
 <pre class="prettyprint">var lightSensor = tizen.sensorservice.getDefaultSensor(&quot;LIGHT&quot;);
 
@@ -159,15 +159,15 @@ function onchangedCB(sensorData)
 }
 
 &sol;&sol; use the default interval value (100 ms):
-proximitySensor.setChangeListener(onchangedCB);
+lightSensor.setChangeListener(onchangedCB);
 
-proximitySensor.start(onsuccessCB);</pre>
+lightSensor.start(onsuccessCB);</pre>
 
 </li>
 
 <li>To stop receiving notifications on sensor data changes, use the <span style="font-family: Courier New,Courier,monospace">unsetChangeListener()</span> method of the Sensor interface.
 
-<pre class="prettyprint">proximitySensor.unsetChangeListener();</pre>
+<pre class="prettyprint">lightSensor.unsetChangeListener();</pre>
 </li>
 </ol>
           
index dea0ebf..02c1019 100644 (file)
@@ -196,7 +196,7 @@ RUNNING - The user is running            </li>
 <pre class="webidl prettyprint">    enum ActivityRecognitionType { "STATIONARY", "WALKING", "RUNNING", "IN_VEHICLE" };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="description">
           <p>
@@ -222,7 +222,7 @@ IN_VEHICLE - The in-vehicle activity recognition type            </li>
 <pre class="webidl prettyprint">    enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="description">
           <p>
@@ -427,7 +427,7 @@ That means that both <b>'http://tizen.org/privilege/healthinfo'</b> and <b>'http
 For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be declared.
             </p>
 <p><span class="remark"> Remark : </span>
- <em>option</em> is supported since Tizen 2.3.2
+ <em>option</em> is supported since Tizen 3.0
             </p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
@@ -442,7 +442,7 @@ For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be d
                 </li>
           <li class="param">
 <span class="name">option</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
- The option to set the period and the interval for several human activity types since Tizen 2.3.2<br>By default, this parameter is set to null.
+ The option to set the period and the interval for several human activity types since Tizen 3.0<br>By default, this parameter is set to null.
                 </li>
         </ul>
 </div>
@@ -673,7 +673,7 @@ Note that the setAccumulativePedometerListener() method does not need to call th
              </pre></div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 <div class="description">
             <p>
@@ -747,7 +747,7 @@ The <em>ErrorCallback</em> method is launched with this error type:
              </pre></div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 <div class="description">
             <p>
@@ -1288,7 +1288,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
     };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="attributes">
 <h4>Dictionary members</h4>
@@ -1296,11 +1296,11 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
 <dt class="member" id="HumanActivityMonitorOption::callbackInterval"><span class="attrName">long? callbackInterval</span></dt>
 <dd>
 <div class="brief">
- The <em>callbackInterval</em> in milliseconds (ms) at which human activity data will be sent to the Web Application since Tizen 2.3.2<br>For the GPS type, <em>callbackInterval</em> can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.<br>For the HRM type, <em>callbackInterval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.<br>For other activity types, <em>callbackInterval</em> will be ignored.
+ The <em>callbackInterval</em> in milliseconds (ms) at which human activity data will be sent to the Web Application since Tizen 3.0<br>For the GPS type, <em>callbackInterval</em> can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.<br>For the HRM type, <em>callbackInterval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.<br>For other activity types, <em>callbackInterval</em> will be ignored.
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </dd>
 <dt class="member" id="HumanActivityMonitorOption::sampleInterval"><span class="attrName">long? sampleInterval</span></dt>
@@ -1310,7 +1310,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </dd>
 </dl>
@@ -1331,7 +1331,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
     };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
         
       <div class="attributes">
@@ -1344,7 +1344,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 <li class="attribute" id="HumanActivityRecognitionData::timestamp">
@@ -1354,7 +1354,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 <li class="attribute" id="HumanActivityRecognitionData::accuracy">
@@ -1364,7 +1364,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 </ul>
index 942d751..d0d7fcd 100644 (file)
@@ -532,7 +532,7 @@ Note that the setChangeListener() method only registers the listener.
 The start() method must be called to turn on the sensor, or the sensor data will not change.
             </p>
            </div>
-<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 2.3.2</p>
+<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 3.0</p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
 <ul>
index 7423831..71b6c3e 100644 (file)
@@ -196,7 +196,7 @@ RUNNING - The user is running            </li>
 <pre class="webidl prettyprint">    enum ActivityRecognitionType { "STATIONARY", "WALKING", "RUNNING", "IN_VEHICLE" };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="description">
           <p>
@@ -222,7 +222,7 @@ IN_VEHICLE - The in-vehicle activity recognition type            </li>
 <pre class="webidl prettyprint">    enum ActivityAccuracy { "LOW", "MEDIUM", "HIGH" };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="description">
           <p>
@@ -427,7 +427,7 @@ That means that both <b>'http://tizen.org/privilege/healthinfo'</b> and <b>'http
 For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be declared.
             </p>
 <p><span class="remark"> Remark : </span>
- <em>option</em> is supported since Tizen 2.3.2
+ <em>option</em> is supported since Tizen 3.0
             </p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
@@ -442,7 +442,7 @@ For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be d
                 </li>
           <li class="param">
 <span class="name">option</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
- The option to set the period and the interval for several human activity types since Tizen 2.3.2<br>By default, this parameter is set to null.
+ The option to set the period and the interval for several human activity types since Tizen 3.0<br>By default, this parameter is set to null.
                 </li>
         </ul>
 </div>
@@ -673,7 +673,7 @@ Note that the setAccumulativePedometerListener() method does not need to call th
              </pre></div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 <div class="description">
             <p>
@@ -747,7 +747,7 @@ The <em>ErrorCallback</em> method is launched with this error type:
              </pre></div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 <div class="description">
             <p>
@@ -1288,7 +1288,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
     };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
 <div class="attributes">
 <h4>Dictionary members</h4>
@@ -1296,11 +1296,11 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
 <dt class="member" id="HumanActivityMonitorOption::callbackInterval"><span class="attrName">long? callbackInterval</span></dt>
 <dd>
 <div class="brief">
- The <em>callbackInterval</em> in milliseconds (ms) at which human activity data will be sent to the Web Application since Tizen 2.3.2<br>For the GPS type, <em>callbackInterval</em> can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.<br>For the HRM type, <em>callbackInterval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.<br>For other activity types, <em>callbackInterval</em> will be ignored.
+ The <em>callbackInterval</em> in milliseconds (ms) at which human activity data will be sent to the Web Application since Tizen 3.0<br>For the GPS type, <em>callbackInterval</em> can be between 120000ms and 600000ms inclusive, however, if it is null or zero, it is set by the default value of 120000ms.<br>For the HRM type, <em>callbackInterval</em> can be between 10ms and 1000ms inclusive, however, if it is null or zero, it is set set by the default value of 100ms.<br>For other activity types, <em>callbackInterval</em> will be ignored.
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </dd>
 <dt class="member" id="HumanActivityMonitorOption::sampleInterval"><span class="attrName">long? sampleInterval</span></dt>
@@ -1310,7 +1310,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </dd>
 </dl>
@@ -1331,7 +1331,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
     };</pre>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
           </p>
         
       <div class="attributes">
@@ -1344,7 +1344,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 <li class="attribute" id="HumanActivityRecognitionData::timestamp">
@@ -1354,7 +1354,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 <li class="attribute" id="HumanActivityRecognitionData::accuracy">
@@ -1364,7 +1364,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             </div>
 <p><span class="version">
             Since: </span>
- 2.3.2
+ 3.0
             </p>
 </li>
 </ul>
index 068805c..22577ba 100644 (file)
@@ -532,7 +532,7 @@ Note that the setChangeListener() method only registers the listener.
 The start() method must be called to turn on the sensor, or the sensor data will not change.
             </p>
            </div>
-<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 2.3.2</p>
+<p><span class="remark">Remark: </span><em>interval</em> is supported since Tizen 3.0</p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
 <ul>