d2d-manager: Modify API header files align with ACR rules
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 26 Mar 2018 05:11:42 +0000 (14:11 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:49 +0000 (19:38 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
capi/include/companion.h
capi/src/companion.c
capi/src/companion_debug.h [moved from capi/include/companion_debug.h with 100% similarity]

index 4da28b7..01960e4 100644 (file)
@@ -33,7 +33,13 @@ extern "C" {
  * @addtogroup CAPI_NETWORK_COMMON_COMPANION_MODULE
  * @{
  */
+
 #ifndef TIZEN_ERROR_COMP
+/**
+ * @brief Base error codes for companion-manager.
+ *
+ * @since_tizen 5.0
+ */
 #define TIZEN_ERROR_COMP -0x02F50000 /**< Base error code */
 #endif
 
@@ -191,6 +197,9 @@ typedef void (*companion_device_eject_result_cb)(int result, void *user_data);
  *
  * @since_tizen 5.0
  *
+ * @remarks The @resp_data should not be released.
+ * @remarks The @resp_data can be used only in the callback. To use outside, make a copy.
+ *
  * @param[out] result Result of operation
  * @param[out] resp_data Retrieved data
  * @param[out] user_data User data pointer
@@ -263,8 +272,8 @@ int companion_deinitialize();
 /* companion_group_create : craete group in my daemon */
 
 /**
- * @brief Create group
- * @details This API is to allocate new group in local companion-manager
+ * @brief Creates a group.
+ * @details This function is to allocate new group in local companion-manager.
  *
  * @since_tizen 5.0
  *
@@ -281,8 +290,8 @@ int companion_deinitialize();
 int companion_group_create(char *group_name);
 
 /**
- * @brief Finds group resources in local and the network
- * @details This API is find group resources in the network plus my local network.
+ * @brief Finds group resources in local and the network.
+ * @details This function is find group resources in the network plus my local network.
  *
  * @since_tizen 5.0
  *
@@ -306,8 +315,8 @@ int companion_group_find(
                void *user_data);
 
 /**
- * @brief Gets a list of group resources
- * @details This API retrieves a list of group resources found.
+ * @brief Gets a list of group resources.
+ * @details This function retrieves a list of group resources found.
  *
  * @since_tizen 5.0
  *
@@ -328,12 +337,12 @@ int companion_group_get_found_groups(companion_group_h **groups,
 
 /**
  * @brief Joins the remote group.
- * @details This API allows users to join a device to a remote group.
+ * @details This function allows users to join a device to a remote group.
  * if group handle is my owns, then the API returns failure.
  *
  * @since_tizen 5.0
  *
- * @param[in] groups Group resource list
+ * @param[in] group Group resource list
  * @param[in] callback Callback handler to retrieve the found group resource
  * @param[in] user_data User data poiter
  *
@@ -354,7 +363,7 @@ int companion_group_join(companion_group_h group,
 
 /**
  * @brief Leaves my own devices from the remote group.
- * @details This API allows my own device to be removed from the remote group.
+ * @details This function allows my own device to be removed from the remote group.
  *
  * @since_tizen 5.0
  *
@@ -379,7 +388,7 @@ int companion_group_leave(companion_group_h group,
 
 /**
  * @brief Deletes the group.
- * @details This API deletes a specific group and expels all devices in that group.
+ * @details This function deletes a specific group and expels all devices in that group.
  *
  * @since_tizen 5.0
  *
@@ -401,7 +410,7 @@ int companion_group_delete(companion_group_h group);
 
 /**
  * @brief Combines both groups to one.
- * @details This API combines two groups into one.
+ * @details This function combines two groups into one.
  *
  * @since_tizen 5.0
  *
@@ -424,13 +433,15 @@ int companion_group_merge(companion_group_h dest_group,
                companion_group_h src_group);
 
 /**
- * @brief Gets devices list in a group resource
- * @details This API retrieves a devices list of group resources.
+ * @brief Gets devices list in a group resource.
+ * @details This function retrieves a devices list of group resources.
  *
  * @since_tizen 5.0
  *
- * @param[in] groups Group resource list
- * @param[out] groups Group resource list
+ * @remarks The @devices should be released using companion_device_destroy().
+ *
+ * @param[in] group Group resource list
+ * @param[out] devices Device list
  * @param[out] count Number of devices in a group
  *
  *
@@ -453,7 +464,7 @@ int companion_group_get_member_devices(companion_group_h group,
 
 /**
  * @brief Finds candidate devices to include my groups in the network.
- * @details This API will search for candidate devices that can be included in local group.
+ * @details This function will search for candidate devices that can be included in local group.
  *
  * @since_tizen 5.0
  *
@@ -477,8 +488,8 @@ int companion_device_find(
                void *user_data);
 
 /**
- * @brief Gets a list of candidate devices to can be included my group
- * @details This API retrieves a list of multiple owner enabled devices found.
+ * @brief Gets a list of candidate devices to can be included my group.
+ * @details This function retrieves a list of multiple owner enabled devices found.
  *
  * @since_tizen 5.0
  *
@@ -499,7 +510,7 @@ int companion_device_get_found_devices(
 
 /**
  * @brief Finds my owned devices in the network.
- * @details This API looks up devices on your network that are registered as multiple
+ * @details This function looks up devices on your network that are registered as multiple
  * owners.
  *
  * @since_tizen 5.0
@@ -524,8 +535,8 @@ int companion_device_find_mowned_device(
                void *user_data);
 
 /**
- * @brief Gets a list of discovered owned devices
- * @details This API retrieves a list of my owned devices found.
+ * @brief Gets a list of discovered owned devices.
+ * @details This function retrieves a list of my owned devices found.
  *
  * @since_tizen 5.0
  *
@@ -547,7 +558,7 @@ int companion_device_get_found_mowned_devices(
 
 /**
  * @brief Requests to invite a device to the group which local device owns.
- * @details This API invites a remote device to a specific group. At the time of invitation,
+ * @details This function invites a remote device to a specific group. At the time of invitation,
  * user can enter the authentication information (i.e., PIN) or use the certificate.
  *
  * @since_tizen 5.0
@@ -581,7 +592,7 @@ int companion_device_invite(
 
 /**
  * @brief Requests to expel the device from the group which local device owns.
- * @details This API is used to kick away a remote devices in my local group.
+ * @details This function is used to kick away a remote devices in my local group.
  *
  * @since_tizen 5.0
  *
@@ -609,8 +620,8 @@ int companion_device_eject(
                void *user_data);
 
 /**
- * @brief Get my local device handle.
- * @details This API returns the local device information handle.
+ * @brief Gets my local device handle.
+ * @details This function returns the local device information handle.
  *
  * @since_tizen 5.0
  *
@@ -626,11 +637,13 @@ int companion_device_eject(
 int companion_device_get_my_device(companion_device_h *device);
 
 /**
- * @brief Get my local device ID.
- * @details This API returns current UUID of local device.
+ * @brief Gets my local device ID.
+ * @details This function returns current UUID of local device.
  *
  * @since_tizen 5.0
  *
+ * @remarks The @uuid should not be released.
+ *
  * @param[in] uuid Local device UUID
  *
  * @return 0 on success, otherwise a negative error value.
@@ -649,6 +662,8 @@ int companion_device_get_my_uuid(char **uuid);
  *
  * @since_tizen 5.0
  *
+ * @remarks The @group should be released using companion_group_information_destroy().
+ *
  * @param[in] group Group handle
  *
  * @return 0 on success, otherwise a negative error value.
@@ -671,6 +686,8 @@ int companion_group_information_create(companion_group_h* group);
  *
  * @since_tizen 5.0
  *
+ * @remarks The @dst should be released using companion_group_information_destroy().
+ *
  * @param[out] dst Destination group handle
  * @param[in] src Source group handle
  *
@@ -741,6 +758,8 @@ int companion_group_information_get_type(companion_group_h group,
  *
  * @since_tizen 5.0
  *
+ * @remarks The @resource_type should be released using free().
+ *
  * @param[in] group Group handle
  * @param[out] resource_type Resource type
  *
@@ -765,6 +784,8 @@ int companion_group_information_get_resource_type(
  *
  * @since_tizen 5.0
  *
+ * @remarks The @uri_path should be released using free().
+ *
  * @param[in] group Group handle
  * @param[out] uri_path URI path
  *
@@ -789,6 +810,8 @@ int companion_group_information_get_uri_path(companion_group_h group,
  *
  * @since_tizen 5.0
  *
+ * @remarks The @name should be released using free().
+ *
  * @param[in] group Group handle
  * @param[out] name Name of the group
  *
@@ -813,6 +836,8 @@ int companion_group_information_get_name(companion_group_h group,
  *
  * @since_tizen 5.0
  *
+ * @remarks The @host_addr should be released using free().
+ *
  * @param[in] group Group handle
  * @param[out] host_addr Host address of the group
  *
@@ -835,10 +860,12 @@ int companion_group_information_get_host_addr(companion_group_h group,
 /* Group Device Information Module */
 
 /**
- * @brief Create a device handle.
+ * @brief Creates a device handle.
  *
  * @since_tizen 5.0
  *
+ * @remarks The @device should be released using companion_device_information_destroy().
+ *
  * @param[in] device Device handle
  *
  * @return 0 on success, otherwise a negative error value.
@@ -859,8 +886,10 @@ int companion_device_information_create(companion_device_h* device);
  *
  * @since_tizen 5.0
  *
+ * @remarks The @target should be released using companion_device_information_destroy().
+ *
  * @param[out] target Target device handle
- * @param[int] source Source device handle
+ * @param[in] source Source device handle
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #COMP_ERROR_NONE Successful
@@ -897,10 +926,12 @@ int companion_device_information_clone(companion_device_h target,
 int companion_device_information_destroy(companion_device_h device);
 
 /**
- * @brief Get device ID of the device handle.
+ * @brief Gets device ID of the device handle.
  *
  * @since_tizen 5.0
  *
+ * @remarks The @device_id should be released using free().
+ *
  * @param[in] device Device handle
  * @param[out] device_id Device ID
  *
@@ -919,10 +950,12 @@ int companion_device_information_get_device_id(companion_device_h device,
                char **device_id);
 
 /**
- * @brief Get IP of the device handle.
+ * @brief Gets IP of the device handle.
  *
  * @since_tizen 5.0
  *
+ * @remarks The @ip should be released using free().
+ *
  * @param[in] device Device handle
  * @param[out] ip IP address
  *
@@ -940,10 +973,12 @@ int companion_device_information_get_device_id(companion_device_h device,
 int companion_device_information_get_ip(companion_device_h device, char **ip);
 
 /**
- * @brief Get device type of the device handle.
+ * @brief Gets device type of the device handle.
  *
  * @since_tizen 5.0
  *
+ * @remarks The @device_type should be released using free().
+ *
  * @param[in] device Device handle
  * @param[out] device_type Device type
  *
@@ -972,6 +1007,8 @@ int companion_device_information_get_device_type(companion_device_h device,
  * @param[in] device Device handle
  * @param[in] data Data to send
  * @param[in] len What length to send
+ * @param[in] finish_cb Callback to be called after companion_send_data() complete
+ * @param[in] user_data User data pointer
  *
  *
  * @return 0 on success, otherwise a negative error value.
@@ -1014,7 +1051,7 @@ int companion_request_create_group(companion_device_h device, char *group_name);
 
 /**
  * @brief Requests to invite a device to the group.
- * @details This API invites a remote device to a specific group. At the time of invitation,
+ * @details This function invites a remote device to a specific group. At the time of invitation,
  * user can enter the authentication information (i.e., PIN) or use the certificate.
  *
  * @since_tizen 5.0
@@ -1040,7 +1077,7 @@ int companion_request_invite(companion_group_h group, companion_device_h device,
 
 /**
  * @brief Requests to eject a device.
- * @details This API is used to kick away a remote devices in a specific group.
+ * @details This function is used to kick away a remote devices in a specific group.
  *
  * @since_tizen 5.0
  *
@@ -1063,7 +1100,7 @@ int companion_request_eject(companion_group_h group, companion_device_h device);
 
 /**
  * @brief Requests to delete the group.
- * @details This API deletes a specific group and expels all devices in that group.
+ * @details This function deletes a specific group and expels all devices in that group.
  *
  * @since_tizen 5.0
  *
@@ -1085,7 +1122,7 @@ int companion_request_delete_group(companion_group_h group);
 
 /**
  * @brief Registers request result callback funtion.
- * @details This API registers the callback function for requested group management
+ * @details This function registers the callback function for requested group management
  * functions and receive processing results after the request complete.
  *
  * @since_tizen 5.0
@@ -1116,4 +1153,4 @@ int companion_request_result_callback(companion_request_result_cb callback,
 }
 #endif
 
-#endif /* __TIZEN_NETWORK_COMMON_COMPANION_H__ */
+#endif /* __TIZEN_NETWORK_COMMON_COMPANION_H__ */
\ No newline at end of file
index 1e6c0ae..14e0d22 100644 (file)
@@ -900,14 +900,19 @@ EXPORT_API int companion_group_information_clone(companion_group_h target,
 
        if (src->uri_path)
                dst->uri_path = g_strdup(src->uri_path);
+
        if (src->device_id)
                dst->device_id = g_strdup(src->device_id);
+
        if (src->group_name)
                dst->group_name = g_strdup(src->group_name);
+
        if (src->host_addr)
                dst->host_addr = g_strdup(src->host_addr);
+
        if (src->resource_type)
                dst->resource_type = g_strdup(src->resource_type);
+
        dst->type = src->type;
 
        return 0;