Add comments about return value and version information 48/74848/7 accepted/tizen/common/20160623.154022 accepted/tizen/ivi/20160623.121833 accepted/tizen/mobile/20160623.121737 accepted/tizen/tv/20160623.121755 accepted/tizen/wearable/20160623.121810 submit/tizen/20160622.081854
authorKichan Kwon <k_c.kwon@samsung.com>
Thu, 16 Jun 2016 01:26:15 +0000 (10:26 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 17 Jun 2016 02:09:09 +0000 (11:09 +0900)
Change-Id: Id71487fe0570105e259f57b804a0076c5495626d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
include/runtime_info.h
src/runtime_info_system.c
src/runtime_info_usage.c

index cf890cf..b4267a2 100644 (file)
@@ -31,6 +31,7 @@ extern "C"
 
 /**
  * @brief Enumeration for error codes for runtime information.
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
        RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE,                             /**< Successful */
@@ -39,11 +40,13 @@ typedef enum {
        RUNTIME_INFO_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR,                     /**< An input/output error occurred when read value from system */
        RUNTIME_INFO_ERROR_REMOTE_IO = TIZEN_ERROR_REMOTE_IO,                   /**< Remote I/O error occured */
        RUNTIME_INFO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,   /**< No permission to use the api */
-       RUNTIME_INFO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,                   /**< Not supported parameter @if MOBILE (Since 2.3.1) @endif */
+       RUNTIME_INFO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,                   /**< Not supported parameter */
+       RUNTIME_INFO_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA /**< No data available (Since 3.0) */
 } runtime_info_error_e;
 
 /**
  * @brief Enumeration for keys for runtime information..
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
        RUNTIME_INFO_KEY_BLUETOOTH_ENABLED                                      = 2,    /**<Indicates whether Bluetooth is enabled. */
@@ -68,6 +71,7 @@ typedef enum {
 
 /**
  * @brief Enumeration for Wi-Fi status.
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
        RUNTIME_INFO_WIFI_STATUS_DISABLED,                              /**< GPS is disabled. */
@@ -77,6 +81,7 @@ typedef enum {
 
 /**
  * @brief Enumeration for GPS status.
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
        RUNTIME_INFO_GPS_STATUS_DISABLED,                               /**< GPS is disabled. */
@@ -86,6 +91,7 @@ typedef enum {
 
 /**
  * @brief Enumeration for audio jack status.
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
        RUNTIME_INFO_AUDIO_JACK_STATUS_UNCONNECTED,             /**< Audio jack is not connected */
@@ -96,7 +102,7 @@ typedef enum {
 
 /**
  * @brief   Called when the runtime information changes
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in] key       The type of notification
  * @param[in] user_data The user data passed from the callback registration function
@@ -112,7 +118,7 @@ typedef void (*runtime_info_changed_cb)(runtime_info_key_e key, void *user_data)
  * @brief   Gets the integer value of the runtime information.
  * @details This function gets current state of the given key which represents specific runtime information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in]  key   The runtime information status key from which data should be read
  * @param[out] value The current value of the given key
@@ -124,7 +130,7 @@ typedef void (*runtime_info_changed_cb)(runtime_info_key_e key, void *user_data)
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
- * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter
  */
 int runtime_info_get_value_int(runtime_info_key_e key, int *value);
 
@@ -132,7 +138,7 @@ int runtime_info_get_value_int(runtime_info_key_e key, int *value);
  * @brief   Gets the boolean value from the runtime information.
  * @details This function gets current state of the given key which represents specific runtime information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in]  key   The runtime information key from which data should be read
  * @param[out] value The current value of the given key
@@ -144,7 +150,7 @@ int runtime_info_get_value_int(runtime_info_key_e key, int *value);
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
- * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter
  */
 int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
 
@@ -152,7 +158,7 @@ int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
  * @brief   Gets the double value from the runtime information.
  * @details This function gets current state of the given key which represents specific runtime information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in]  key   The runtime information key from which data should be read
  * @param[out] value The current value of the given key
@@ -164,7 +170,7 @@ int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
- * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter
  */
 int runtime_info_get_value_double(runtime_info_key_e key, double *value);
 
@@ -172,7 +178,7 @@ int runtime_info_get_value_double(runtime_info_key_e key, double *value);
  * @brief   Gets the string value for specified runtime information.
  * @details This function gets current state of the given key which represents specific runtime information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @remarks  You must release @a value using free().
  *
@@ -187,14 +193,14 @@ int runtime_info_get_value_double(runtime_info_key_e key, double *value);
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR          An input/output error occurred when read value from system
  * @retval  #RUNTIME_INFO_ERROR_OUT_OF_MEMORY     Out of memory
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
- * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter
  */
 int runtime_info_get_value_string(runtime_info_key_e key, char **value);
 
 
 /**
  * @brief   Registers a change event callback for given runtime information key.
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in] key       The runtime information type
  * @param[in] callback  The callback function to invoke
@@ -206,7 +212,7 @@ int runtime_info_get_value_string(runtime_info_key_e key, char **value);
  * @retval  #RUNTIME_INFO_ERROR_NONE              Successful
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
- * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter @if MOBILE (Since 2.3.1) @endif
+ * @retval  #RUNTIME_INFO_ERROR_NOT_SUPPORTED     Not supported parameter
  * @post runtime_info_changed_cb() will be invoked.
  *
  * @see runtime_info_unset_changed_cb()
@@ -217,7 +223,7 @@ int runtime_info_set_changed_cb(runtime_info_key_e key, runtime_info_changed_cb
 
 /**
  * @brief   Unregisters the callback function.
- * @since_tizen 2.3
+ * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  *
  * @param[in] key The runtime information type
  *
@@ -387,6 +393,7 @@ int runtime_info_get_processor_count(int *num_core);
  * @retval  #RUNTIME_INFO_ERROR_NONE  Successful
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR  An I/O error occurred (during file open operation)
+ * @retval  #RUNTIME_INFO_ERROR_NO_DATA  No data available (Since 3.0)
  */
 int runtime_info_get_processor_current_frequency(int core_idx, int *cpu_freq);
 
@@ -400,6 +407,7 @@ int runtime_info_get_processor_current_frequency(int core_idx, int *cpu_freq);
  * @retval  #RUNTIME_INFO_ERROR_NONE  Successful
  * @retval  #RUNTIME_INFO_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval  #RUNTIME_INFO_ERROR_IO_ERROR  An I/O error occurred (during file open operation)
+ * @retval  #RUNTIME_INFO_ERROR_NO_DATA  No data available (Since 3.0)
  */
 int runtime_info_get_processor_max_frequency(int core_idx, int *cpu_freq);
 
index fb48f74..3f3bae9 100644 (file)
@@ -367,6 +367,6 @@ int runtime_info_get_frequency_cpuinfo(int core_idx, int *cpu_freq)
        }
 
        fclose(cpuinfo_fp);
-       return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+       return RUNTIME_INFO_ERROR_NO_DATA;
 }
 //LCOV_EXCL_STOP
index ea2a007..6e8d3e6 100644 (file)
@@ -471,9 +471,9 @@ API int runtime_info_get_processor_current_frequency(int core_idx, int *cpu_freq
                case RUNTIME_INFO_ERROR_NONE:
                        _I("Notice : it is max CPU frequency");
                        break;
-               case RUNTIME_INFO_ERROR_NOT_SUPPORTED:
+               case RUNTIME_INFO_ERROR_NO_DATA:
                        _E("This system doesn't support MHz information in the cpuinfo");
-                       return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+                       return RUNTIME_INFO_ERROR_NO_DATA;
                default:
                        _E("Fail to get current CPU frequency");
                        return RUNTIME_INFO_ERROR_IO_ERROR;
@@ -514,9 +514,9 @@ API int runtime_info_get_processor_max_frequency(int core_idx, int *cpu_freq)
                switch (runtime_info_get_frequency_cpuinfo(core_idx, cpu_freq)) {
                case RUNTIME_INFO_ERROR_NONE:
                        break;
-               case RUNTIME_INFO_ERROR_NOT_SUPPORTED:
+               case RUNTIME_INFO_ERROR_NO_DATA:
                        _E("This system doesn't support MHz information in the cpuinfo");
-                       return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+                       return RUNTIME_INFO_ERROR_NO_DATA;
                default:
                        _E("Fail to get current CPU frequency");
                        return RUNTIME_INFO_ERROR_IO_ERROR;