From 67a0e50a5e09e1770fa070228b47fc4a9ef076a3 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Fri, 15 Apr 2016 11:28:39 +0900 Subject: [PATCH] [3.0][runtime-info] Add new tutorial sub-part Getting Runtime Information - Using Key-Value Pair (existing; just add title) - Using Function (new) Change-Id: I9cd561626f860d83b42733fe7fec8b02bfdb6e53 Signed-off-by: Kichan Kwon --- .../html/native/system/runtime_tutorial_n.htm | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm b/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm index 7dabce2..ace697b 100644 --- a/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/system/runtime_tutorial_n.htm @@ -55,7 +55,9 @@

Getting Runtime Information

-

The runtime information consists of key and value pairs.

+

Using Key-Value Pair

+ +

Some runtime information consists of key and value pairs.

To get information on, for example, whether Bluetooth is enabled or an audio jack connected:

  1. To use the functions and data types of the Runtime information API (in mobile and wearable applications), include the <runtime_info.h> header file in your application:

    @@ -119,6 +121,38 @@ func(void) }
+

Using Function

+ +

Some runtime information can be gotten by using function.

+

To get information on, for example, the current frequency of CPU core 0:

+
    +
  1. To use the functions and data types of the Runtime information API (in mobile and wearable applications), include the <runtime_info.h> header file in your application:

    +
    +#include <runtime_info.h>
    +
  2. + +
  3. Use the runtime_info_get_processor_current_frequency function with the appropriate arguments.

    + +
    +void
    +func(void)
    +{
    +   int core_idx = 0;
    +   int freq;
    +   int ret;
    +
    +   ret = runtime_info_get_processor_current_frequency(core_idx, &freq);
    +   if (ret != RUNTIME_INFO_ERROR_NONE)
    +   {
    +      // Error handling
    +      return;
    +   }
    +   dlog_print(DLOG_INFO, LOG_TAG, "The frequency of CPU core 0 : %d", freq);
    +}
    +
+ + +

Monitoring Runtime Information Changes

Applications can be notified about changes in the runtime information.

-- 2.7.4