COMP_ERROR_OPERATION_FAILED = TIZEN_ERROR_COMP | 0x04, /**< Operation Failed */
COMP_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_COMP | 0x05, /**< Operation now in progress */
COMP_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_COMP | 0x06, /**< Already initilized */
+ COMP_ERROR_NO_DATA = TIZEN_ERROR_COMP | 0x07, /**< No Data */
COMP_ERROR_UNKNOWN = -999,
} comp_error_e;
} companion_group_type_e;
/**
- * @brief Device hande which represents a companion device.
- *
- * @since_tizen 5.0
+ * @addtogroup CAPI_NETWORK_COMPANION_DEVICE_MODULE
+ * @{
*/
-typedef void *companion_group_h; /**< Group handle */
/**
* @brief Group handle which represents a companion group.
* @since_tizen 5.0
*/
typedef void *companion_device_h; /**< Device handle */
-
-
/**
- * @brief Called after companion_group_find().
- * @details This function can receive a group resource found.
- *
- * @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @remarks The @a group should not be released.
- * @remarks The @a group can be used only in the callback. To use outside, make a copy.
- *
- * @param[out] type Companion group type
- * @param[out] group Group resource found
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_group_find()
- *
- * @see companion_group_find()
+ * @}
*/
-typedef bool (*companion_group_found_cb)(companion_group_type_e type,
- companion_group_h group, void *user_data);
/**
- * @brief Called after companion_device_find().
- * @details This function can receive a device found.
- *
- * @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @remarks The @a device should not be released.
- * @remarks The @a device can be used only in the callback. To use outside, make a copy.
- *
- * @param[out] device Device found
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_device_find()
- *
- * @see companion_device_find()
+ * @addtogroup CAPI_NETWORK_COMPANION_GROUP_MODULE
+ * @{
*/
-typedef bool (*companion_device_found_cb)(companion_device_h device, void *user_data);
/**
- * @brief Called after companion_group_find() finished.
- * @details Called when the maximum wait time elapsed after the companion_group_find() done.
+ * @brief Device hande which represents a companion device.
*
* @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @param[out] result Result of operation
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_group_find()
- *
- * @see companion_group_find()
*/
-typedef void (*companion_group_find_finish_cb)(int result, void *user_data);
-
+typedef void *companion_group_h; /**< Group handle */
/**
- * @brief Called after companion_device_find() finished.
- * @details Called when the maximum wait time elapsed after the companion_device_find() done.
- *
- * @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @param[out] result Result of operation
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_device_find()
- *
- * @see companion_device_find()
+ * @}
*/
-typedef void (*companion_device_find_finish_cb)(int result, void *user_data);
/**
- * @brief Called after companion_device_invite().
- * @details Called when the maximum wait time elapsed or after the companion_device_invite()
- * finished successfully.
- *
+ * @brief Initializes companion-manager.
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[out] result Result of operation
- * @param[out] user_data User data pointer
+ * @remarks You must release @a handle using companion_deinitialize().
*
- * @pre The callback must be registered with companion_device_invite()
+ * @param[out] handle The companion manager handle
*
- * @see companion_device_invite()
+ * @return @c 0 on success, otherwise negative error value
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_ALREADY_INITIALIZED Already initialized
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
+ * @retval #COMP_ERROR_OUT_OF_MEMORY Out of memory
*/
-typedef void (*companion_device_invite_result_cb)(int result, void *user_data);
+int companion_initialize(companion_h *handle);
/**
- * @brief Called after companion_device_eject().
- * @details Called when the maximum wait time elapsed or after the companion_device_eject()
- * finished successfully.
- *
+ * @brief Deinitializes the companion-manager.
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[out] result Result of operation
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_device_eject()
+ * @param[in] handle The companion manager handle
*
- * @see companion_device_eject()
+ * @return 0 on success, otherwise negative error value
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
*/
-typedef void (*companion_device_eject_result_cb)(int result, void *user_data);
+int companion_deinitialize(companion_h handle);
/**
- * @brief Called after companion_send_data().
- * @details Called when the maximum wait time elapsed or after the companion_send_data()
- * finished successfully.
+ * @brief Gets my local device ID.
+ * @details This function returns current UUID of local device.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a resp_data should not be released.
- * @remarks The @a resp_data can be used only in the callback. To use outside, make a copy.
+ * @remarks The @a uuid should not be released.
+ * @remarks The @a uuid 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
+ * @param[in] handle The companion manager handle
+ * @param[out] uuid Local device UUID
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @pre The callback must be registered with companion_send_data()
+ * @see companion_device_get_my_device()
*
- * @see companion_send_data()
*/
-typedef void (*companion_send_data_finish_cb)(int result, char *resp_data,
- void *user_data);
+int companion_device_get_my_uuid(companion_h handle, char **uuid);
/**
- * @brief Callback function potiner to be regsitered by calling
- * companion_request_result_callback().
- *
- * @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @remarks The @a cmd, @arg should not be released.
- * @remarks The @a cmd, @arg can be used only in the callback. To use outside, make a copy.
- *
- * @param[out] cmd Command
- * @param[out] arg Argument
- * @param[out] ret Return code
- * @param[out] user_data User data pointer
- *
- * @pre The callback must be registered with companion_request_result_callback()
- *
- * @see companion_send_data()
+ * @}
*/
-typedef void (*companion_request_result_cb)(char *cmd, char *arg, int ret,
- void *user_data);
-/* Management Module APIs*/
/**
- * @brief Initializes companion-manager.
- * @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @remarks You must release @a handle using companion_deinitialize().
- *
- * @param[out] handle The companion manager handle
- *
- * @return @c 0 on success, otherwise negative error value
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_ALREADY_INITIALIZED Already initialized
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
- * @retval #COMP_ERROR_OUT_OF_MEMORY Out of memory
+ * @addtogroup CAPI_NETWORK_COMPANION_GROUP_MODULE
+ * @{
*/
-int companion_initialize(companion_h *handle);
/**
- * @brief Deinitializes the companion-manager.
+ * @brief Called after companion_group_find().
+ * @details This function can receive a group resource found.
+ *
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
+ * @remarks The @a group should not be released.
+ * @remarks The @a group can be used only in the callback. To use outside, make a copy.
*
- * @return 0 on success, otherwise negative error value
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
+ * @param[out] type Companion group type
+ * @param[out] group Group resource found
+ * @param[out] user_data User data pointer
+ *
+ * @pre The callback must be registered with companion_group_find()
+ *
+ * @see companion_group_find()
*/
-int companion_deinitialize(companion_h handle);
-
-/* Group Module APIs*/
-
-/* companion_group_create : craete group in my daemon */
+typedef bool (*companion_group_found_cb)(companion_group_type_e type,
+ companion_group_h group, void *user_data);
/**
- * @brief Creates a group.
- * @details This function is to allocate new group in local companion-manager.
+ * @brief Called after companion_group_find() finished.
+ * @details Called when the maximum wait time elapsed after the companion_group_find() done.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] group_name Group name
+ * @param[out] result Result of operation
+ * @param[out] user_data User data pointer
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre The callback must be registered with companion_group_find()
*
* @see companion_group_find()
- * @see companion_group_get_found_groups()
- *
*/
-int companion_group_create(companion_h handle, char *group_name);
+typedef void (*companion_group_find_finish_cb)(int result, void *user_data);
/**
* @brief Finds group resources in local and the network.
companion_group_h **groups, int *count);
/**
- * @brief Joins the 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
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
- *
- * @param[in] handle The companion manager handle
- * @param[in] group Group resource list
- * @param[in] callback Callback handler to retrieve the found group resource
- * @param[in] user_data User data poiter
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see companion_group_create()
- * @see companion_group_leave()
- * @see companion_group_delete()
- * @see companion_group_merge()
- * @see companion_group_get_member_devices()
- *
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_COMPANION_LOCAL_GROUP_MODULE
+ * @{
*/
-int companion_group_join(companion_h handle, companion_group_h group,
- companion_group_find_finish_cb callback, void *user_data);
+
/**
- * @brief Leaves my own devices from the remote group.
- * @details This function allows my own device to be removed from the remote group.
+ * @brief Creates a group.
+ * @details This function is to allocate new group in local companion-manager.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
* @param[in] handle The companion manager handle
- * @param[in] group Group handle
- * @param[in] callback Callback handler to retrieve the found group resource
- * @param[in] user_data User data poiter
- *
+ * @param[in] group_name Group name
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_group_create()
- * @see companion_group_join()
- * @see companion_group_delete()
- * @see companion_group_merge()
- * @see companion_group_get_member_devices()
+ * @see companion_group_find()
+ * @see companion_group_get_found_groups()
*
*/
-int companion_group_leave(companion_h handle, companion_group_h group,
- companion_group_find_finish_cb callback, void *user_data);
+int companion_group_create(companion_h handle, char *group_name);
/**
* @brief Deletes the group.
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_group_create()
- * @see companion_group_join()
- * @see companion_group_leave()
+ * @see companion_request_join_group()
+ * @see companion_request_leave_group ()
* @see companion_group_merge()
* @see companion_group_get_member_devices()
*
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_group_create()
- * @see companion_group_join()
- * @see companion_group_leave()
+ * @see companion_request_join_group()
+ * @see companion_request_leave_group ()
* @see companion_group_delete()
* @see companion_group_get_member_devices()
*
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_group_create()
- * @see companion_group_join()
- * @see companion_group_leave()
+ * @see companion_request_join_group()
+ * @see companion_request_leave_group ()
* @see companion_group_delete()
* @see companion_group_merge()
*
int companion_group_get_member_devices(companion_h handle,
companion_group_h group, companion_device_h **devices, int *count);
-
-/* Device Module */
-
/**
- * @brief Finds candidate devices to include my groups in the network.
- * @details This function will search for candidate devices that can be included in local group.
+ * @brief Called after companion_group_invite_device().
+ * @details Called when the maximum wait time elapsed or after the companion_group_invite_device()
+ * finished successfully.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] timeout Time to find
- * @param[in] found_cb Callback handler to retrieve the found device
- * @param[in] finish_cb Callback handler to know finding process finished
- * @param[in] user_data User data poiter
- *
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[out] result Result of operation
+ * @param[out] user_data User data pointer
*
- * @see companion_device_get_found_devices()
+ * @pre The callback must be registered with companion_group_invite_device()
*
+ * @see companion_group_invite_device()
*/
-int companion_device_find(companion_h handle, int timeout,
- companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb,
- void *user_data);
+typedef void (*companion_group_invite_device_result_cb)(int result, void *user_data);
/**
- * @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.
+ * @brief Called after companion_group_eject_device().
+ * @details Called when the maximum wait time elapsed or after the companion_device_eject()
+ * finished successfully.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @param[out] result Result of operation
+ * @param[out] user_data User data pointer
+ *
+ * @pre The callback must be registered with companion_device_eject()
+ *
+ * @see companion_group_ejecct_device()
+ */
+typedef void (*companion_group_eject_device_result_cb)(int result, void *user_data);
+
+/**
+ * @brief Requests to invite a device to the group which local device owns.
+ * @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
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
* @param[in] handle The companion manager handle
- * @param[in] devices Device list
- * @param[in] count Number of devices
+ * @param[in] group Group handle
+ * @param[in] device Device handle
+ * @param[in] PIN PIN number
+ * @param[in] callback Callback handler to receive the result
+ * @param[in] user_data User data poiter
*
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_find_mowned_device()
+ * @see companion_request_create_group()
+ * @see companion_request_eject_device()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_device_send_data()
*
*/
-int companion_device_get_found_devices(companion_h handle,
- companion_device_h **devices, int *count);
+int companion_group_invite_device(companion_h handle, companion_group_h group,
+ companion_device_h device, char *PIN,
+ companion_group_invite_device_result_cb callback, void *user_data);
/**
- * @brief Finds my owned devices in the network.
- * @details This function looks up devices on your network that are registered as multiple
- * owners.
+ * @brief Requests to expel the device from the group which local device owns.
+ * @details This function is used to kick away a remote devices in my local group.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
* @param[in] handle The companion manager handle
- * @param[in] timeout Time to find
- * @param[in] found_cb Callback handler to retrieve the found device
- * @param[in] finish_cb Callback handler to know finding process finished
+ * @param[in] group Group handle
+ * @param[in] device Device handle
+ * @param[in] callback Callback handler to receive the result
* @param[in] user_data User data poiter
*
*
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_get_found_mowned_devices()
+ * @see companion_request_create_group()
+ * @see companion_request_eject_device()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_device_send_data()
*
*/
-int companion_device_find_mowned_device(companion_h handle, int timeout,
- companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb,
+int companion_group_eject_device(companion_h handle, companion_group_h group,
+ companion_device_h device, companion_group_eject_device_result_cb callback,
void *user_data);
+
/**
- * @brief Gets a list of discovered owned devices.
- * @details This function retrieves a list of my owned devices found.
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_COMPANION_REMOTE_GROUP_MODULE
+ * @{
+ */
+
+/**
+ * @brief Callback function potiner to be regsitered by calling request to remote groups.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ *
+ * @param[out] result Return code
+ * @param[out] user_data User data pointer
+ *
+ * @see companion_request_join_group()
+ * @see companion_request_leave_group()
+ * @see companion_device_send_data()
+ * @see companion_device_send_data()
+ */
+typedef void (*companion_request_done_cb)(int result, void *user_data);
+
+/**
+ * @brief Requests my device to be joined to remote group.
+ * @details This function requests a remote groups to join my device in the remote groups.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
* @param[in] handle The companion manager handle
- * @param[in] devices Device list
- * @param[in] count Number of devices
+ * @param[in] group Group resource list
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
*
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_find_mowned_device()
+ * @see companion_group_create()
+ * @see companion_request_leave_group ()
+ * @see companion_request_create_group()
+ * @see companion_request_invite_device()
+ * @see companion_request_eject_device()
+ * @see companion_request_delete_group()
*
*/
-int companion_device_get_found_mowned_devices(companion_h handle,
- companion_device_h **devices, int *count);
+int companion_request_join_group(companion_h handle, companion_group_h group,
+ companion_request_done_cb cb, void *user_data);
-/* companion_group_device_invite : Invite a remote group device to my local group. */
+/**
+ * @brief Requests my device to be exit from remote group.
+ * @details This function requests remote groups to exit my devices that belonged to the
+ * remote group.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @param[in] handle The companion manager handle
+ * @param[in] group Group handle
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
+ *
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_create()
+ * @see companion_request_join_group()
+ * @see companion_group_delete()
+ * @see companion_group_merge()
+ * @see companion_group_get_member_devices()
+ *
+ */
+int companion_request_leave_group (companion_h handle, companion_group_h group,
+ companion_request_done_cb cb, void *user_data);
/**
- * @brief Requests to invite a device to the group which local device owns.
- * @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.
+ * @brief Requests to create a group.
+ * @details We can create a group. This generated group can include device, and remote
+ * devices can inquire remotely group information and device information included in group.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @param[in] handle The companion manager handle
+ * @param[in] device Device handle
+ * @param[in] group_name Group name
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
+ *
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_request_invite_device()
+ * @see companion_request_eject_device()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_device_send_data()
+ *
+ */
+int companion_request_create_group(companion_h handle,
+ companion_device_h device, char *group_name, companion_request_done_cb cb,
+ void *user_data);
+
+/**
+ * @brief Requests to invite a device to the group.
+ * @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
* @privlevel public
* @param[in] group Group handle
* @param[in] device Device handle
* @param[in] PIN PIN number
- * @param[in] callback Callback handler to receive the result
- * @param[in] user_data User data poiter
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
*
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_request_create_group()
- * @see companion_request_eject()
+ * @see companion_request_eject_device()
* @see companion_request_delete_group()
* @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_send_data()
*
*/
-int companion_device_invite(companion_h handle, companion_group_h group,
- companion_device_h device, char *PIN, companion_device_invite_result_cb callback,
+int companion_request_invite_device(companion_h handle, companion_group_h group,
+ companion_device_h device, char *PIN, companion_request_done_cb cb,
void *user_data);
-/* companion_group_device_eject : Eject a remote group device from my group. */
-
/**
- * @brief Requests to expel the device from the group which local device owns.
- * @details This function is used to kick away a remote devices in my local group.
+ * @brief Requests to eject a device.
+ * @details This function is used to kick away a remote devices in a specific group.
*
* @since_tizen 5.0
* @privlevel public
* @param[in] handle The companion manager handle
* @param[in] group Group handle
* @param[in] device Device handle
- * @param[in] callback Callback handler to receive the result
- * @param[in] user_data User data poiter
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
*
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_request_create_group()
- * @see companion_request_eject()
+ * @see companion_request_eject_device()
* @see companion_request_delete_group()
* @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_send_data()
*
*/
-int companion_device_eject(companion_h handle, companion_group_h group,
- companion_device_h device, companion_device_eject_result_cb callback,
- void *user_data);
+int companion_request_eject_device(companion_h handle, companion_group_h group,
+ companion_device_h device, companion_request_done_cb cb, void *user_data);
/**
- * @brief Gets my local device handle.
- * @details This function returns the local device information handle.
+ * @brief Requests to delete the group.
+ * @details This function deletes a specific group and expels all devices in that group.
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
* @param[in] handle The companion manager handle
- * @param[in] device Local device handle
+ * @param[in] group Group handle
+ * @param[in] cb Callback handler to receive the result
+ * @param[in] user_data User data pointer
+ *
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_get_my_uuid()
+ * @see companion_request_create_group()
+ * @see companion_request_invite_device()
+ * @see companion_request_eject_device()
+ * @see companion_request_result_callback()
+ * @see companion_device_send_data()
*
*/
-int companion_device_get_my_device(companion_h handle,
- companion_device_h *device);
+int companion_request_delete_group(companion_h handle, companion_group_h group,
+ companion_request_done_cb cb, void *user_data);
/**
- * @brief Gets my local device ID.
- * @details This function returns current UUID of local device.
+ * @brief Callback function potiner to be regsitered by calling
+ * companion_request_result_callback().
*
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a uuid should not be released.
- * @remarks The @a uuid can be used only in the callback. To use outside, make a copy.
+ * @remarks The @a cmd, @arg should not be released.
+ * @remarks The @a cmd, @arg can be used only in the callback. To use outside, make a copy.
+ *
+ * @param[out] cmd Command
+ * @param[out] arg Argument
+ * @param[out] ret Return code
+ * @param[out] user_data User data pointer
+ *
+ * @pre The callback must be registered with companion_request_result_callback()
+ *
+ * @see companion_request_result_callback()
+ */
+typedef void (*companion_request_result_cb)(char *cmd, char *arg, int ret,
+ void *user_data);
+
+/**
+ * @brief Registers request result callback funtion.
+ * @details This function registers the callback function for requested group management
+ * functions and receive processing results after the request complete.
+ *
+ * @since_tizen 5.0
*
* @param[in] handle The companion manager handle
- * @param[out] uuid Local device UUID
+ * @param[in] callback Callback function pointer
+ * @param[in] user_data User data pointer
+ *
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_get_my_device()
+ * @see companion_request_create_group()
+ * @see companion_request_invite_device()
+ * @see companion_request_eject_device()
+ * @see companion_request_delete_group()
+ * @see companion_device_send_data()
*
*/
-int companion_device_get_my_uuid(companion_h handle, char **uuid);
+int companion_request_result_callback(companion_h handle,
+ companion_request_result_cb callback, void *user_data);
+
+/**
+ * @}
+ */
-/* Group Information Module */
+/**
+ * @addtogroup CAPI_NETWORK_COMPANION_GROUP_INFORMATION_MODULE
+ * @{
+ */
/**
* @brief Creates a group handle.
int companion_group_information_get_host_addr(companion_group_h group,
char **host_addr);
-/* Group Device Information Module */
+/**
+ * @}
+ */
+
/**
- * @brief Creates a device handle.
+ * @addtogroup CAPI_NETWORK_COMPANION_DEVICE_MODULE
+ * @{
+ */
+
+
+/**
+ * @brief Called after companion_device_find().
+ * @details This function can receive a device found.
*
* @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a device should be released using companion_device_information_destroy().
- *
- * @param[out] device Device handle
+ * @remarks The @a device should not be released.
+ * @remarks The @a device can be used only in the callback. To use outside, make a copy.
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[out] device Device found
+ * @param[out] user_data User data pointer
*
- * @see companion_device_information_clone()
- * @see companion_device_information_destroy()
- * @see companion_device_information_get_device_id()
- * @see companion_device_information_get_ip()
- * @see companion_device_information_get_device_type()
+ * @pre The callback must be registered with companion_device_find()
*
+ * @see companion_device_find()
*/
-int companion_device_information_create(companion_device_h* device);
+typedef bool (*companion_device_found_cb)(companion_device_h device, void *user_data);
/**
- * @brief Clones the device handle.
+ * @brief Called after companion_device_find() finished.
+ * @details Called when the maximum wait time elapsed after the companion_device_find() done.
*
* @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a target should be released using companion_device_information_destroy().
- *
- * @param[in] target Target device handle
- * @param[in] source Source device handle
+ * @param[out] result Result of operation
+ * @param[out] user_data User data pointer
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #COMP_ERROR_NONE Successful
- * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre The callback must be registered with companion_device_find()
*
- * @see companion_device_information_create()
- * @see companion_device_information_destroy()
- * @see companion_device_information_get_device_id()
- * @see companion_device_information_get_ip()
- * @see companion_device_information_get_device_type()
+ * @see companion_device_find()
+ */
+typedef void (*companion_device_find_finish_cb)(int result, void *user_data);
+
+
+/**
+ * @brief Called after companion_device_send_data().
+ * @details Called when the maximum wait time elapsed or after the companion_device_send_data()
+ * finished successfully.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @remarks The @a resp_data should not be released.
+ * @remarks The @a 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
*
+ * @pre The callback must be registered with companion_device_send_data()
+ *
+ * @see companion_device_send_data()
*/
-int companion_device_information_clone(companion_device_h target,
- companion_device_h source);
+typedef void (*companion_device_send_data_finish_cb)(int result, char *resp_data,
+ void *user_data);
+
/**
- * @brief Destroys the device handle.
+ * @brief Finds candidate devices to include my groups in the network.
+ * @details This function will search for candidate devices that can be included in local group.
*
* @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @param[in] handle The companion manager handle
+ * @param[in] timeout Time to find
+ * @param[in] found_cb Callback handler to retrieve the found device
+ * @param[in] finish_cb Callback handler to know finding process finished
+ * @param[in] user_data User data poiter
*
- * @param[in] device Device handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_information_create()
- * @see companion_device_information_clone()
- * @see companion_device_information_get_device_id()
- * @see companion_device_information_get_ip()
- * @see companion_device_information_get_device_type()
+ * @see companion_device_get_found_devices()
*
*/
-int companion_device_information_destroy(companion_device_h device);
+int companion_device_find(companion_h handle, int timeout,
+ companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb,
+ void *user_data);
/**
- * @brief Gets device ID of the device handle.
+ * @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
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a device_id should be released using free().
+ * @param[in] handle The companion manager handle
+ * @param[in] devices Device list
+ * @param[in] count Number of devices
*
- * @param[in] device Device handle
- * @param[out] device_id Device ID
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_information_create()
- * @see companion_device_information_clone()
- * @see companion_device_information_destroy()
- * @see companion_device_information_get_ip()
- * @see companion_device_information_get_device_type()
+ * @see companion_device_find_mowned_device()
*
*/
-int companion_device_information_get_device_id(companion_device_h device,
- char **device_id);
+int companion_device_get_found_devices(companion_h handle,
+ companion_device_h **devices, int *count);
/**
- * @brief Gets IP of the device handle.
+ * @brief Finds my owned devices in the network.
+ * @details This function looks up devices on your network that are registered as multiple
+ * owners.
*
* @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a ip should be released using free().
+ * @param[in] handle The companion manager handle
+ * @param[in] timeout Time to find
+ * @param[in] found_cb Callback handler to retrieve the found device
+ * @param[in] finish_cb Callback handler to know finding process finished
+ * @param[in] user_data User data poiter
*
- * @param[in] device Device handle
- * @param[out] ip IP address
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_information_create()
- * @see companion_device_information_clone()
- * @see companion_device_information_destroy()
- * @see companion_device_information_get_device_id()
- * @see companion_device_information_get_device_type()
+ * @see companion_device_get_found_mowned_devices()
*
*/
-int companion_device_information_get_ip(companion_device_h device, char **ip);
+int companion_device_find_mowned_device(companion_h handle, int timeout,
+ companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb,
+ void *user_data);
/**
- * @brief Gets device type of the device handle.
+ * @brief Gets a list of discovered owned devices.
+ * @details This function retrieves a list of my owned devices found.
*
* @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
*
- * @remarks The @a device_type should be released using free().
+ * @param[in] handle The companion manager handle
+ * @param[in] devices Device list
+ * @param[in] count Number of devices
*
- * @param[in] device Device handle
- * @param[out] device_type Device type
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_device_information_create()
- * @see companion_device_information_clone()
- * @see companion_device_information_destroy()
- * @see companion_device_information_get_device_id()
- * @see companion_device_information_get_ip()
+ * @see companion_device_find_mowned_device()
*
*/
-int companion_device_information_get_device_type(companion_device_h device,
- char **device_type);
+int companion_device_get_found_mowned_devices(companion_h handle,
+ companion_device_h **devices, int *count);
-/* Group Management Module */
+
+/**
+ * @brief Gets my local device handle.
+ * @details This function returns the local device information handle.
+ *
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @param[in] handle The companion manager handle
+ * @param[in] device Local device handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMP_ERROR_NO_DATA No data
+ *
+ * @see companion_device_get_my_uuid()
+ *
+ */
+int companion_device_get_my_device(companion_h handle,
+ companion_device_h *device);
/**
* @brief Sends data to the remote 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] finish_cb Callback to be called after companion_device_send_data() complete
* @param[in] user_data User data pointer
*
*
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see companion_request_create_group()
- * @see companion_request_invite()
- * @see companion_request_eject()
+ * @see companion_request_invite_device()
+ * @see companion_request_eject_device()
* @see companion_request_delete_group()
* @see companion_request_result_callback()
*
*/
-int companion_send_data(companion_h handle, companion_device_h device, char *data,
- int len, companion_send_data_finish_cb finish_cb, void *user_data);
+int companion_device_send_data(companion_h handle, companion_device_h device, char *data,
+ int len, companion_device_send_data_finish_cb finish_cb, void *user_data);
/**
- * @brief Requests to create a group.
- * @details We can create a group. This generated group can include device, and remote
- * devices can inquire remotely group information and device information included in group.
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_COMPANION_DEVICE_INFORMATION_MODULE
+ * @{
+ */
+
+/**
+ * @brief Creates a device handle.
*
* @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] device Device handle
- * @param[in] group_name Group name
+ * @remarks The @a device should be released using companion_device_information_destroy().
*
+ * @param[out] device Device handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_request_invite()
- * @see companion_request_eject()
- * @see companion_request_delete_group()
- * @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_information_clone()
+ * @see companion_device_information_destroy()
+ * @see companion_device_information_get_device_id()
+ * @see companion_device_information_get_ip()
+ * @see companion_device_information_get_device_type()
*
*/
-int companion_request_create_group(companion_h handle,
- companion_device_h device, char *group_name);
+int companion_device_information_create(companion_device_h* device);
/**
- * @brief Requests to invite a device to the group.
- * @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.
+ * @brief Clones the device handle.
*
* @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] group Group handle
- * @param[in] device Device handle
- * @param[in] PIN PIN number
+ * @remarks The @a target should be released using companion_device_information_destroy().
*
+ * @param[in] target Target device handle
+ * @param[in] source Source device handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_request_create_group()
- * @see companion_request_eject()
- * @see companion_request_delete_group()
- * @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_information_create()
+ * @see companion_device_information_destroy()
+ * @see companion_device_information_get_device_id()
+ * @see companion_device_information_get_ip()
+ * @see companion_device_information_get_device_type()
*
*/
-int companion_request_invite(companion_h handle, companion_group_h group,
- companion_device_h device, char *PIN);
+int companion_device_information_clone(companion_device_h target,
+ companion_device_h source);
/**
- * @brief Requests to eject a device.
- * @details This function is used to kick away a remote devices in a specific group.
+ * @brief Destroys the device handle.
*
* @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] group Group handle
* @param[in] device Device handle
*
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_device_information_create()
+ * @see companion_device_information_clone()
+ * @see companion_device_information_get_device_id()
+ * @see companion_device_information_get_ip()
+ * @see companion_device_information_get_device_type()
+ *
+ */
+int companion_device_information_destroy(companion_device_h device);
+
+/**
+ * @brief Gets device ID of the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @remarks The @a device_id should be released using free().
+ *
+ * @param[in] device Device handle
+ * @param[out] device_id Device ID
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_request_create_group()
- * @see companion_request_eject()
- * @see companion_request_delete_group()
- * @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_information_create()
+ * @see companion_device_information_clone()
+ * @see companion_device_information_destroy()
+ * @see companion_device_information_get_ip()
+ * @see companion_device_information_get_device_type()
*
*/
-int companion_request_eject(companion_h handle, companion_group_h group,
- companion_device_h device);
+int companion_device_information_get_device_id(companion_device_h device,
+ char **device_id);
/**
- * @brief Requests to delete the group.
- * @details This function deletes a specific group and expels all devices in that group.
+ * @brief Gets IP of the device handle.
*
* @since_tizen 5.0
- * @privlevel public
- * @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The companion manager handle
- * @param[in] group Group handle
+ * @remarks The @a ip should be released using free().
*
+ * @param[in] device Device handle
+ * @param[out] ip IP address
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_request_create_group()
- * @see companion_request_invite()
- * @see companion_request_eject()
- * @see companion_request_result_callback()
- * @see companion_send_data()
+ * @see companion_device_information_create()
+ * @see companion_device_information_clone()
+ * @see companion_device_information_destroy()
+ * @see companion_device_information_get_device_id()
+ * @see companion_device_information_get_device_type()
*
*/
-int companion_request_delete_group(companion_h handle, companion_group_h group);
+int companion_device_information_get_ip(companion_device_h device, char **ip);
/**
- * @brief Registers request result callback funtion.
- * @details This function registers the callback function for requested group management
- * functions and receive processing results after the request complete.
+ * @brief Gets device type of the device handle.
*
* @since_tizen 5.0
*
- * @param[in] handle The companion manager handle
- * @param[in] callback Callback function pointer
- * @param[in] user_data User data pointer
+ * @remarks The @a device_type should be released using free().
*
+ * @param[in] device Device handle
+ * @param[out] device_type Device type
*
* @return 0 on success, otherwise a negative error value.
* @retval #COMP_ERROR_NONE Successful
* @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
*
- * @see companion_request_create_group()
- * @see companion_request_invite()
- * @see companion_request_eject()
- * @see companion_request_delete_group()
- * @see companion_send_data()
+ * @see companion_device_information_create()
+ * @see companion_device_information_clone()
+ * @see companion_device_information_destroy()
+ * @see companion_device_information_get_device_id()
+ * @see companion_device_information_get_ip()
*
*/
-int companion_request_result_callback(companion_h handle,
- companion_request_result_cb callback, void *user_data);
+int companion_device_information_get_device_type(companion_device_h device,
+ char **device_type);
/**
* @}
*/
+
#ifdef __cplusplus
}
#endif
-#endif /* __TIZEN_NETWORK_COMPANION_H__ */
\ No newline at end of file
+#endif /* __TIZEN_NETWORK_COMPANION_H__ */