* @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
*
* @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
/* 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
*
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
*
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
*
/**
* @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
*
/**
* @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
*
/**
* @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
*
/**
* @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
*
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
*
*
/**
* @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
*
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
*
/**
* @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
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
*
/**
* @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
/**
* @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
*
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
*
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.
*
* @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.
*
* @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
*
*
* @since_tizen 5.0
*
+ * @remarks The @resource_type should be released using free().
+ *
* @param[in] group Group handle
* @param[out] resource_type 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
*
*
* @since_tizen 5.0
*
+ * @remarks The @name should be released using free().
+ *
* @param[in] group Group handle
* @param[out] name Name of the 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
*
/* 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.
*
* @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
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
*
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
*
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
*
* @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.
/**
* @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
/**
* @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
*
/**
* @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
*
/**
* @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
}
#endif
-#endif /* __TIZEN_NETWORK_COMMON_COMPANION_H__ */
+#endif /* __TIZEN_NETWORK_COMMON_COMPANION_H__ */
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__
-#define __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__
-
-#include <stdio.h>
-
-#define NOTUSED(var) (var = var)
-
-#define COLOR_BLACK "\033[0;30m"
-#define COLOR_RED "\033[0;31m"
-#define COLOR_GREEN "\033[0;32m"
-#define COLOR_BROWN "\033[0;33m"
-#define COLOR_BLUE "\033[0;34m"
-#define COLOR_PURPLE "\033[0;35m"
-#define COLOR_CYAN "\033[0;36m"
-#define COLOR_GRAY "\033[0;37m"
-#define COLOR_END "\033[0;m"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "COMP_MANAGER_CAPI"
-
-#define _ERR(fmt, ...) \
- do { \
- LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__); \
- } while (0)
-
-#define _INFO(fmt, ...) \
- do { \
- LOGI(COLOR_GREEN fmt COLOR_END, ##__VA_ARGS__); \
- } while (0)
-
-#define _WARN(fmt, ...) \
- do { \
- LOGI(COLOR_BROWN fmt COLOR_END, ##__VA_ARGS__); \
- } while (0)
-
-#define _DBG(fmt, ...) \
- do { \
- LOGD(fmt, ##__VA_ARGS__); \
- } while (0)
-
-#define _BEGIN() \
- do { \
- LOGD(COLOR_BLUE "BEGIN >>>>" COLOR_END); \
- } while (0)
-
-#define _END() \
- do { \
- LOGD(COLOR_BLUE "END <<<<" COLOR_END); \
- } while (0)
-
-#define cond_expr_ret(expr, val) \
- do { \
- if (expr) { \
- _ERR("[precond fail] expr : %s, ret : %d\n", #expr, val); \
- return (val); \
- } \
- } while (0)
-
-#define cond_ret(val) \
- do { \
- if (val) { \
- _ERR("[precond fail] ret : %d\n", val); \
- return (val); \
- } \
- } while (0)
-
-#define companion_check_null_ret_error(name, value, error) do { \
- /* LCOV_EXCL_START */ \
- if (G_UNLIKELY(NULL == (value))) { \
- LOGE("%s is NULL", name); \
- return error; \
- } \
- /* LCOV_EXCL_STOP */ \
-} while (FALSE)
-
-#define companion_check_null_ret(name, value) do { \
- /* LCOV_EXCL_START */ \
- if (G_UNLIKELY(NULL == (value))) { \
- LOGE("%s is NULL", name); \
- return; \
- } \
- /* LCOV_EXCL_STOP */ \
-} while (FALSE)
-
-
-#define PRT(format, args...) printf("%s:%d() "format, __FUNCTION__, __LINE__, ##args)
-#define TC_PRT(format, args...) PRT(format"\n", ##args)
-
-#endif /* __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__
+#define __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__
+
+#include <stdio.h>
+
+#define NOTUSED(var) (var = var)
+
+#define COLOR_BLACK "\033[0;30m"
+#define COLOR_RED "\033[0;31m"
+#define COLOR_GREEN "\033[0;32m"
+#define COLOR_BROWN "\033[0;33m"
+#define COLOR_BLUE "\033[0;34m"
+#define COLOR_PURPLE "\033[0;35m"
+#define COLOR_CYAN "\033[0;36m"
+#define COLOR_GRAY "\033[0;37m"
+#define COLOR_END "\033[0;m"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "COMP_MANAGER_CAPI"
+
+#define _ERR(fmt, ...) \
+ do { \
+ LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__); \
+ } while (0)
+
+#define _INFO(fmt, ...) \
+ do { \
+ LOGI(COLOR_GREEN fmt COLOR_END, ##__VA_ARGS__); \
+ } while (0)
+
+#define _WARN(fmt, ...) \
+ do { \
+ LOGI(COLOR_BROWN fmt COLOR_END, ##__VA_ARGS__); \
+ } while (0)
+
+#define _DBG(fmt, ...) \
+ do { \
+ LOGD(fmt, ##__VA_ARGS__); \
+ } while (0)
+
+#define _BEGIN() \
+ do { \
+ LOGD(COLOR_BLUE "BEGIN >>>>" COLOR_END); \
+ } while (0)
+
+#define _END() \
+ do { \
+ LOGD(COLOR_BLUE "END <<<<" COLOR_END); \
+ } while (0)
+
+#define cond_expr_ret(expr, val) \
+ do { \
+ if (expr) { \
+ _ERR("[precond fail] expr : %s, ret : %d\n", #expr, val); \
+ return (val); \
+ } \
+ } while (0)
+
+#define cond_ret(val) \
+ do { \
+ if (val) { \
+ _ERR("[precond fail] ret : %d\n", val); \
+ return (val); \
+ } \
+ } while (0)
+
+#define companion_check_null_ret_error(name, value, error) do { \
+ /* LCOV_EXCL_START */ \
+ if (G_UNLIKELY(NULL == (value))) { \
+ LOGE("%s is NULL", name); \
+ return error; \
+ } \
+ /* LCOV_EXCL_STOP */ \
+} while (FALSE)
+
+#define companion_check_null_ret(name, value) do { \
+ /* LCOV_EXCL_START */ \
+ if (G_UNLIKELY(NULL == (value))) { \
+ LOGE("%s is NULL", name); \
+ return; \
+ } \
+ /* LCOV_EXCL_STOP */ \
+} while (FALSE)
+
+
+#define PRT(format, args...) printf("%s:%d() "format, __FUNCTION__, __LINE__, ##args)
+#define TC_PRT(format, args...) PRT(format"\n", ##args)
+
+#endif /* __TIZEN_NETWORK_COMMON_COMPANION_DEBUG_H__ */