Fix api doxygen and error code 46/324646/3
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 22 May 2025 06:52:39 +0000 (15:52 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 22 May 2025 06:57:48 +0000 (15:57 +0900)
- Fix doxygen to match the actual error codes.
- Remove unused error code.
- Add ACTION_ERROR_CONNECTION_REFUSED.

Change-Id: Ic3e17c0a68c2301adab06a462a1cb31c2ced1183
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/api/action.h
src/api/action_error.h
src/api/api_stub.cc

index e141939797db58f04a50d5c153c46eb5575631fb..30b55edf585062ed84f46d82519e39ef6e5840fa 100644 (file)
@@ -56,7 +56,10 @@ typedef void (*action_result_cb)(int execution_id, const char *json_result, void
  * @brief Creates a action client handle.
  * @param[out] client The action handle.
  * @retval #ACTION_ERROR_NONE Successful
+ * @retval #ACTION_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #ACTION_ERROR_CONNECTION_REFUSED Connection refused
  * @retval #ACTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see action_client_destroy()
  */
 int action_client_create(action_client_h *client);
 
@@ -65,28 +68,31 @@ int action_client_create(action_client_h *client);
  * @param[in] action The action handle.
  * @retval #ACTION_ERROR_NONE Successful
  * @retval #ACTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see action_client_create()
  */
 int action_client_destroy(action_client_h client);
 
 /**
- * @brief Retrieves all actions.
+ * @brief Gets the action handle.
  * @param[in] client The action client handle.
- * @param[in] cb The callback function to get each action.
- * @param[in] user_data The user data to be passed to the callback function.
+ * @param[in] name The name of action.
+ * @param[in] action The action handle.
  * @retval #ACTION_ERROR_NONE Successful
+ * @retval #ACTION_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #ACTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see action_destroy()
  */
-int action_client_foreach_action(action_client_h client, action_foreach_action_cb cb, void *user_data);
+int action_client_get_action(action_client_h client, const char *name, action_h *action);
 
 /**
- * @brief Gets the action handle
+ * @brief Retrieves all actions.
  * @param[in] client The action client handle.
- * @param[in] name The name of action.
- * @param[in] action The action handle.
+ * @param[in] cb The callback function to get each action.
+ * @param[in] user_data The user data to be passed to the callback function.
  * @retval #ACTION_ERROR_NONE Successful
  * @retval #ACTION_ERROR_INVALID_PARAMETER Invalid parameter
  */
-int action_client_get_action(action_client_h client, const char *name, action_h *action);
+int action_client_foreach_action(action_client_h client, action_foreach_action_cb cb, void *user_data);
 
 /**
  * @brief Executes the action.
@@ -96,6 +102,7 @@ int action_client_get_action(action_client_h client, const char *name, action_h
  * @param[in] user_data The user data to be passed to the callback function.
  * @param[out] execution_id The ID of the action execution. It should be released using free().
  * @retval #ACTION_ERROR_NONE Successful
+ * @retval #ACTION_ERROR_IO_ERROR I/O error
  * @retval #ACTION_ERROR_INVALID_PARAMETER Invalid parameter
  */
 int action_client_execute(action_client_h client, const char *param, action_result_cb cb, void *user_data, int *execution_id);
index ea9b988b0157000f56b20c8d4a48758865833e68..a02dfa6b73208289977546da09d0af33103cb5aa 100644 (file)
@@ -29,15 +29,11 @@ extern "C" {
  */
 typedef enum _action_error {
        ACTION_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
-       ACTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       ACTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
        ACTION_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+       ACTION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
        ACTION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
-       ACTION_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Function not implemented */
-       ACTION_ERROR_FROM_DB = TIZEN_ERROR_NOTIFICATION | 0x01, /**< Error from DB query */
-       ACTION_ERROR_ALREADY_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x02, /**< Already exist private ID */
-       ACTION_ERROR_NOT_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x03, /**< Not exist  ID */
-       ACTION_ERROR_SERVICE_NOT_READY = TIZEN_ERROR_NOTIFICATION | 0x04, /**< No response from action framework service */
+       ACTION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+       ACTION_ERROR_CONNECTION_REFUSED = TIZEN_ERROR_CONNECTION_REFUSED, /**< Connection refused */
 } action_error_e;
 
 #ifdef __cplusplus
index 2f21423496ea90e92d391a9c43828a6dd0d545e1..72cf2d409b685d7acaa2e7efa22daf688008de38 100644 (file)
@@ -44,7 +44,7 @@ API int action_client_create(action_client_h* client) {
   if (!con->Connect()) {
     LOG(ERROR) << "Failed to connect to action service";
     delete con;
-    return ACTION_ERROR_IO_ERROR;
+    return ACTION_ERROR_CONNECTION_REFUSED;
   }
 
   *client = static_cast<action_client_h>(con);