[3.0][runtime-info] Add new tutorial sub-part
authorKichan Kwon <k_c.kwon@samsung.com>
Fri, 15 Apr 2016 02:28:39 +0000 (11:28 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 15 Apr 2016 02:32:50 +0000 (11:32 +0900)
Getting Runtime Information
 - Using Key-Value Pair (existing; just add title)
 - Using Function (new)

Change-Id: I9cd561626f860d83b42733fe7fec8b02bfdb6e53
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm

index 7dabce2..ace697b 100644 (file)
@@ -55,7 +55,9 @@
 
 <h2 id="get" name="get">Getting Runtime Information</h2>
 
-<p>The runtime information consists of key and value pairs.</p>
+<h3 id="get" name="get">Using Key-Value Pair</h3>
+
+<p>Some runtime information consists of key and value pairs.</p>
 <p>To get information on, for example, whether Bluetooth is enabled or an audio jack connected:</p>
 <ol>
 <li><p>To use the functions and data types of the Runtime information API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYSTEM__RUNTIME__INFO__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SYSTEM__RUNTIME__INFO__MODULE.html">wearable</a> applications), include the <span style="font-family: Courier New,Courier,monospace">&lt;runtime_info.h&gt;</span> header file in your application:</p>
@@ -119,6 +121,38 @@ func(void)
 }
 </pre></li></ol>  
 
+<h3 id="get" name="get">Using Function</h3>
+
+<p>Some runtime information can be gotten by using function.</p>
+<p>To get information on, for example, the current frequency of CPU core 0:</p>
+<ol>
+<li><p>To use the functions and data types of the Runtime information API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYSTEM__RUNTIME__INFO__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SYSTEM__RUNTIME__INFO__MODULE.html">wearable</a> applications), include the <span style="font-family: Courier New,Courier,monospace">&lt;runtime_info.h&gt;</span> header file in your application:</p>
+<pre class="prettyprint">
+#include &lt;runtime_info.h&gt;
+</pre></li>
+
+<li><p> Use the <span style="font-family: Courier New,Courier,monospace">runtime_info_get_processor_current_frequency</span> function with the appropriate arguments.</p>
+
+<pre class="prettyprint">
+void
+func(void)
+{
+&nbsp;&nbsp;&nbsp;int core_idx = 0;
+&nbsp;&nbsp;&nbsp;int freq;
+&nbsp;&nbsp;&nbsp;int ret;
+
+&nbsp;&nbsp;&nbsp;ret = runtime_info_get_processor_current_frequency(core_idx, &amp;freq);
+&nbsp;&nbsp;&nbsp;if (ret != RUNTIME_INFO_ERROR_NONE)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Error handling
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;The frequency of CPU core 0 : %d&quot;, freq);
+}
+</pre></li></ol>
+
+
+
 <h2 id="monitor" name="monitor">Monitoring Runtime Information Changes</h2>
 
 <p>Applications can be notified about changes in the runtime information.</p>