* limitations under the License.
*
*/
-#ifndef __COMPANION_H__
-#define __COMPANION_H__
+#ifndef __TIZEN_NETWORK_COMMON_COMPANION_H__
+#define __TIZEN_NETWORK_COMMON_COMPANION_H__
#include <tizen.h>
extern "C" {
#endif
-#define TIZEN_ERROR_COMP 0
+/**
+ * @file companion.h
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_COMMON_COMPANION_MODULE
+ * @{
+ */
+#ifndef TIZEN_ERROR_COMP
+#define TIZEN_ERROR_COMP -0x02F50000 /**< Base error code */
+#endif
-/* error enum */
+/**
+ * @brief Error codes for companion-manager.
+ *
+ * @since_tizen 5.0
+ */
typedef enum {
COMP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
COMP_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
COMP_ERROR_COMM_ERROR = TIZEN_ERROR_COMP | 0x01, /**< communication error */
COMP_ERROR_RX = TIZEN_ERROR_COMP | 0x02, /**< RX error */
COMP_ERROR_TX = TIZEN_ERROR_COMP | 0x03, /**< TX error */
- COMP_ERROR_PLUGIN_FAIL = TIZEN_ERROR_COMP | 0x04, /**< Plugin failed */
- COMP_ERROR_OPERATION_FAILED = TIZEN_ERROR_COMP | 0x05, /**< Operation Failed */
- COMP_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_COMP | 0x06, /**< Already initilized */
+ 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_UNKNOWN = -999,
} comp_error_e;
+/**
+ * @brief Group type.
+ *
+ * @since_tizen 5.0
+ */
typedef enum {
COMPANION_GROUP_TYPE_ERROR = 0, /**< Error */
COMPANION_GROUP_TYPE_MINE = 1, /**< Local type */
COMPANION_GROUP_TYPE_REMOTE = 2, /**< Remote type */
} companion_group_type_e;
-typedef void *companion_group_h;
-typedef void *companion_device_h;
+/**
+ * @brief Device hande which represents a companion device.
+ *
+ * @since_tizen 5.0
+ */
+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 */
+
-typedef bool (*companion_group_found_cb)(companion_group_type_e type, companion_group_h group,
- void *user_data);
+/**
+ * @brief Called after companion_group_find().
+ * @details This function can receive a group resource found.
+ *
+ * @since_tizen 5.0
+ *
+ * @remarks The @group should not be released.
+ * @remarks The @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
+ *
+ * @remarks The @device should not be released.
+ * @remarks The @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()
+ */
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.
+ *
+ * @since_tizen 5.0
+ *
+ * @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);
+
+/**
+ * @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
+ *
+ * @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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[out] result Result of operation
+ * @param[out] user_data User data pointer
+ *
+ * @pre The callback must be registered with companion_device_invite()
+ *
+ * @see companion_device_invite()
+ */
typedef void (*companion_device_invite_result_cb)(int result, void *user_data);
+
+/**
+ * @brief Called after companion_device_eject().
+ * @details Called when the maximum wait time elapsed or after the companion_device_eject()
+ * finished successfully.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_device_eject()
+ */
typedef void (*companion_device_eject_result_cb)(int result, void *user_data);
-typedef void (*companion_send_data_finish_cb)(int result, char *resp_data, void *user_data);
-typedef void (*companion_request_result_cb)(char *cmd, char *arg, int ret, void *user_data);
+
+/**
+ * @brief Called after companion_send_data().
+ * @details Called when the maximum wait time elapsed or after the companion_send_data()
+ * finished successfully.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_send_data()
+ *
+ * @see companion_send_data()
+ */
+typedef void (*companion_send_data_finish_cb)(int result, char *resp_data,
+ void *user_data);
+
+/**
+ * @brief Callback function potiner to be regsitered by calling
+ * companion_request_result_callback().
+ *
+ * @since_tizen 5.0
+ *
+ * @remarks The @cmd, @arg should not be released.
+ * @remarks The @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*/
-int companion_initialize(); /* initialize gdbus connection with manager daemon */
-int companion_deinitialize(); /* deinitialize gdbus connection with manager daemon */
+
+/**
+ * @brief Initializes companion-manager.
+ * @since_tizen 5.0
+ *
+ * @remarks You must release @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_INVALID_OPERATION Invalid operation
+ * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
+ * @retval #COMP_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #COMP_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int companion_initialize();
+
+/**
+ * @brief Deinitializes the companion-manager.
+ * @since_tizen 5.0
+ *
+ * @param[in] handle The companion manager handle
+ *
+ * @return 0 on success, otherwise negative error value
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMP_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #COMP_ERROR_OPERATION_FAILED Operation failed
+ */
+int companion_deinitialize();
/* Group Module APIs*/
+
/* companion_group_create : craete group in my daemon */
-int companion_group_create(char *group_name); /* O */
-/* companion_group_find : find groups in my daemon + remote groups in network */
-int companion_group_find(int timeout, companion_group_found_cb found_cb,
- companion_group_find_finish_cb finish_cb, void *user_data); /* O */
-/* companion_group_find : find groups in my daemon + remote groups in network */
-int companion_group_get_found_groups(companion_group_h **groups,
- int *count); /* O */
-/* companion_group_join : join to remote group. if group handle is my daemon's, then the api return fail error */
-int companion_group_join(companion_group_h group, companion_group_find_finish_cb callback,
- void *user_data);
-/* companion_group_join : leave from remote group. if group handle is my daemon's, then the api return fail error */
-int companion_group_leave(companion_group_h group, companion_group_find_finish_cb callback,
+
+/**
+ * @brief Create group
+ * @details This API is to allocate new group in local companion-manager
+ *
+ * @since_tizen 5.0
+ *
+ * @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_find()
+ * @see companion_group_get_found_groups()
+ *
+ */
+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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] timeout Time to find
+ * @param[in] found_cb Callback handler to retrieve the found group resource
+ * @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
+ *
+ * @see companion_group_create()
+ * @see companion_group_get_found_groups()
+ *
+ */
+int companion_group_find(
+ int timeout,
+ companion_group_found_cb found_cb,
+ companion_group_find_finish_cb finish_cb,
void *user_data);
-/* companion_group_delete : remove group. if group handle is remote group, then the api return fail error */
+
+/**
+ * @brief Gets a list of group resources
+ * @details This API retrieves a list of group resources found.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] groups Group resource list
+ * @param[out] count Number of groups
+ *
+ *
+ * @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_find()
+ *
+ */
+int companion_group_get_found_groups(companion_group_h **groups,
+ int *count);
+
+/**
+ * @brief Joins the remote group.
+ * @details This API 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] 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()
+ *
+ */
+int companion_group_join(companion_group_h group,
+ companion_group_find_finish_cb callback, void *user_data);
+
+/**
+ * @brief Leaves my own devices from the remote group.
+ * @details This API allows my own device to be removed from the remote group.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @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_join()
+ * @see companion_group_delete()
+ * @see companion_group_merge()
+ * @see companion_group_get_member_devices()
+ *
+ */
+int companion_group_leave(companion_group_h group,
+ companion_group_find_finish_cb callback, void *user_data);
+
+/**
+ * @brief Deletes the group.
+ * @details This API deletes a specific group and expels all devices in that group.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ *
+ *
+ * @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_leave()
+ * @see companion_group_merge()
+ * @see companion_group_get_member_devices()
+ *
+ */
int companion_group_delete(companion_group_h group);
-int companion_group_merge(companion_group_h dest_group, companion_group_h src_group);
+
+/**
+ * @brief Combines both groups to one.
+ * @details This API combines two groups into one.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] dest_group Group handle to be united
+ * @param[in] src_group Group handle to be merged
+ *
+ *
+ * @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_leave()
+ * @see companion_group_delete()
+ * @see companion_group_get_member_devices()
+ *
+ */
+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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] groups Group resource list
+ * @param[out] groups Group resource list
+ * @param[out] count Number of devices in a group
+ *
+ *
+ * @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_leave()
+ * @see companion_group_delete()
+ * @see companion_group_merge()
+ *
+ */
int companion_group_get_member_devices(companion_group_h group,
companion_device_h **devices, int *count);
/* Device Module */
-/* The "Device" is only one group device per target.
- If you have any good terms, I would appreciate your suggestions.*/
-
-/* companion_group_device_find : Find the group devices on the network. (exclude myself) */
-int companion_device_find(int timeout, companion_device_found_cb found_cb,
- companion_device_find_finish_cb finish_cb, void *user_data);
-int companion_device_get_found_devices(companion_device_h **devices, int *count);
-int companion_device_find_mowned_device(int timeout,
- companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb, void *user_data);
+
+/**
+ * @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.
+ *
+ * @since_tizen 5.0
+ *
+ * @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
+ *
+ * @see companion_device_get_found_devices()
+ *
+ */
+int companion_device_find(
+ int timeout,
+ companion_device_found_cb found_cb,
+ companion_device_find_finish_cb finish_cb,
+ 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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] devices Device list
+ * @param[in] count Number of devices
+ *
+ *
+ * @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()
+ *
+ */
+int companion_device_get_found_devices(
+ companion_device_h **devices,
+ int *count);
+
+/**
+ * @brief Finds my owned devices in the network.
+ * @details This API looks up devices on your network that are registered as multiple
+ * owners.
+ *
+ * @since_tizen 5.0
+ *
+ * @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
+ *
+ * @see companion_device_get_found_mowned_devices()
+ *
+ */
+int companion_device_find_mowned_device(
+ int timeout,
+ companion_device_found_cb found_cb,
+ companion_device_find_finish_cb finish_cb,
+ void *user_data);
+
+/**
+ * @brief Gets a list of discovered owned devices
+ * @details This API retrieves a list of my owned devices found.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] devices Device list
+ * @param[in] count Number of devices
+ *
+ *
+ * @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()
+ *
+ */
int companion_device_get_found_mowned_devices(
companion_device_h **devices, int *count);
-/* companion_group_device_invite : Invite a remote group device to my group. */
-int companion_device_invite(companion_group_h group,
- companion_device_h device, char *PIN, companion_device_invite_result_cb callback, void *user_data);
+/* companion_group_device_invite : Invite a remote group device to my local group. */
+
+/**
+ * @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,
+ * user can enter the authentication information (i.e., PIN) or use the certificate.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_request_create_group()
+ * @see companion_request_eject()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_send_data()
+ *
+ */
+int companion_device_invite(
+ companion_group_h group,
+ companion_device_h device,
+ char *PIN,
+ companion_device_invite_result_cb callback,
+ void *user_data);
/* companion_group_device_eject : Eject a remote group device from my group. */
-int companion_device_eject(companion_group_h group,
- companion_device_h device, companion_device_eject_result_cb callback, void *user_data);
+/**
+ * @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.
+ *
+ * @since_tizen 5.0
+ *
+ * @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
+ *
+ *
+ * @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()
+ *
+ */
+int companion_device_eject(
+ companion_group_h group,
+ companion_device_h device,
+ companion_device_eject_result_cb callback,
+ void *user_data);
+
+/**
+ * @brief Get my local device handle.
+ * @details This API returns the local device information handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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
+ *
+ * @see companion_device_get_my_uuid()
+ *
+ */
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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] 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
+ *
+ * @see companion_device_get_my_device()
+ *
+ */
int companion_device_get_my_uuid(char **uuid);
/* Group Information Module */
+
+/**
+ * @brief Creates a group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_create(companion_group_h* group);
+
+/**
+ * @brief Clones the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[out] dst Destination group handle
+ * @param[in] src Source group handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_clone(companion_group_h dst,
companion_group_h src);
+
+/**
+ * @brief Destroys the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_destroy(companion_group_h group);
+/**
+ * @brief Gets group type of the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[out] type Group type
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_get_type(companion_group_h group,
companion_group_type_e *type);
+
+/**
+ * @brief Gets resource type of the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[out] resource_type Resource type
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_get_resource_type(
- companion_group_h group, char **resource_type);
+ companion_group_h group, char **resource_type);
+
+/**
+ * @brief Gets URI path of the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[out] uri_path URI path
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_get_uri_path(companion_group_h group,
- char **uri_path);
+ char **uri_path);
+
+/**
+ * @brief Gets name of the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[out] name Name of the group
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_uri_path()
+ * @see companion_group_information_get_host_addr()
+ *
+ */
int companion_group_information_get_name(companion_group_h group,
- char **name);
+ char **name);
+
+/**
+ * @brief Gets host address of the group handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[out] host_addr Host address of the group
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #COMP_ERROR_NONE Successful
+ * @retval #COMP_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see companion_group_information_create()
+ * @see companion_group_information_clone()
+ * @see companion_group_information_destroy()
+ * @see companion_group_information_get_type()
+ * @see companion_group_information_get_resource_type()
+ * @see companion_group_information_get_name()
+ * @see companion_group_information_get_uri_path()
+ *
+ */
int companion_group_information_get_host_addr(companion_group_h group,
- char **host_addr);
+ char **host_addr);
/* Group Device Information Module */
-/* I think the information in the group device is the same as the "device informations" */
+
+/**
+ * @brief Create a device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_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_device_information_create(companion_device_h* device);
+
+/**
+ * @brief Clones the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[out] target Target device handle
+ * @param[int] 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_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_device_information_clone(companion_device_h target,
companion_device_h source);
-int companion_device_information_destroy(companion_device_h data);
+
+/**
+ * @brief Destroys the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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 Get device ID of the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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()
+ *
+ */
int companion_device_information_get_device_id(companion_device_h device,
char **device_id);
+
+/**
+ * @brief Get IP of the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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()
+ *
+ */
int companion_device_information_get_ip(companion_device_h device, char **ip);
-int companion_device_information_get_device_type(
- companion_device_h device, char **device_type);
+/**
+ * @brief Get device type of the device handle.
+ *
+ * @since_tizen 5.0
+ *
+ * @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()
+ *
+ */
+int companion_device_information_get_device_type(companion_device_h device,
+ char **device_type);
+
+/* Group Management Module */
+
+/**
+ * @brief Sends data to the remote device.
+ * @details We can send data to devices included in group.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] device Device handle
+ * @param[in] data Data to send
+ * @param[in] len What length to send
+ *
+ *
+ * @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_request_result_callback()
+ *
+ */
int companion_send_data(companion_device_h device, char *data, int len,
companion_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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] device Device handle
+ * @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_request_invite()
+ * @see companion_request_eject()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_send_data()
+ *
+ */
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,
+ * user can enter the authentication information (i.e., PIN) or use the certificate.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group handle
+ * @param[in] device Device handle
+ * @param[in] PIN PIN number
+ *
+ *
+ * @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()
+ *
+ */
int companion_request_invite(companion_group_h group, companion_device_h device,
char *PIN);
+
+/**
+ * @brief Requests to eject a device.
+ * @details This API is used to kick away a remote devices in a specific group.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_request_create_group()
+ * @see companion_request_eject()
+ * @see companion_request_delete_group()
+ * @see companion_request_result_callback()
+ * @see companion_send_data()
+ *
+ */
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.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] group Group 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_invite()
+ * @see companion_request_eject()
+ * @see companion_request_result_callback()
+ * @see companion_send_data()
+ *
+ */
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
+ * functions and receive processing results after the request complete.
+ *
+ * @since_tizen 5.0
+ *
+ * @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_request_create_group()
+ * @see companion_request_invite()
+ * @see companion_request_eject()
+ * @see companion_request_delete_group()
+ * @see companion_send_data()
+ *
+ */
int companion_request_result_callback(companion_request_result_cb callback,
void *user_data);
+/**
+ * @}
+ */
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* __TIZEN_NETWORK_COMMON_COMPANION_H__ */
\ No newline at end of file
#include <companion_debug.h>
#include <companion_gdbus.h>
-static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#define COMP_DBUS_SERVICE "org.tizen.companion"
-#define COMP_DBUS_GROUP_PATH "/org/tizen/companion/group"
-#define COMP_DBUS_ENABLER_PATH "/org/tizen/companion/enabler"
-
-Group *group_proxy = NULL;
-Enabler *enabler_proxy = NULL;
+/**
+ * Companion Manager CAPI
+ */
-int ref_count = 0;
-bool __is_initialized = false;
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /**< Mutex for dbus */
#define COMPANION_LOCK \
do { \
pthread_mutex_unlock(&mutex); \
} while (0);
+#define COMP_DBUS_SERVICE "org.tizen.companion" /**< For companion dbus */
+#define COMP_DBUS_GROUP_PATH "/org/tizen/companion/group" /**< For group dbus */
+#define COMP_DBUS_ENABLER_PATH "/org/tizen/companion/enabler" /**< dbus auto-activation */
+
+Group *group_proxy = NULL; /**< To receive signal from companion-manager */
+Enabler *enabler_proxy = NULL; /**< Enbler proxy */
+
+int ref_count = 0;
+bool __is_initialized = false;
+
typedef struct _companion_group_t
{
char *uri_path;
g_variant_iter_free(iter);
- group = _create_group_handle(uri_path, device_id, group_name, host_addr, resource_type, type);
+ group = _create_group_handle(uri_path, device_id, group_name, host_addr,
+ resource_type, type);
if (group_found_cb.found_cb)
group_found_cb.found_cb(type, group, group_found_cb.user_data);
}
NULL,
&error);
- g_signal_connect(group_proxy, "group-found", G_CALLBACK(__group_found_cb), NULL);
- g_signal_connect(group_proxy, "group-find-finish", G_CALLBACK(_group_find_finish_cb), NULL);
- g_signal_connect(group_proxy, "device-found", G_CALLBACK(__device_found_cb), NULL);
- g_signal_connect(group_proxy, "device-find-finish", G_CALLBACK(_device_find_finish_cb), NULL);
- g_signal_connect(group_proxy, "mowned-device-found", G_CALLBACK(__mowned_device_found_cb), NULL);
- g_signal_connect(group_proxy, "mowned-device-find-finish", G_CALLBACK(_mowned_device_find_finish_cb), NULL);
- g_signal_connect(group_proxy, "device-invite-result", G_CALLBACK(__device_invite_result_cb), NULL);
- g_signal_connect(group_proxy, "device-eject-result", G_CALLBACK(__device_eject_result_cb), NULL);
- g_signal_connect(group_proxy, "send-data-finish", G_CALLBACK(__send_data_finish_cb), NULL);
- g_signal_connect(group_proxy, "request-result", G_CALLBACK(__request_result_cb), NULL);
+ g_signal_connect(group_proxy,
+ "group-found", G_CALLBACK(__group_found_cb), NULL);
+ g_signal_connect(group_proxy,
+ "group-find-finish", G_CALLBACK(_group_find_finish_cb), NULL);
+ g_signal_connect(group_proxy,
+ "device-found", G_CALLBACK(__device_found_cb), NULL);
+ g_signal_connect(group_proxy,
+ "device-find-finish", G_CALLBACK(_device_find_finish_cb), NULL);
+ g_signal_connect(group_proxy,
+ "mowned-device-found", G_CALLBACK(__mowned_device_found_cb), NULL);
+ g_signal_connect(group_proxy,
+ "mowned-device-find-finish", G_CALLBACK(_mowned_device_find_finish_cb), NULL);
+ g_signal_connect(group_proxy,
+ "device-invite-result", G_CALLBACK(__device_invite_result_cb), NULL);
+ g_signal_connect(group_proxy,
+ "device-eject-result", G_CALLBACK(__device_eject_result_cb), NULL);
+ g_signal_connect(group_proxy,
+ "send-data-finish", G_CALLBACK(__send_data_finish_cb), NULL);
+ g_signal_connect(group_proxy,
+ "request-result", G_CALLBACK(__request_result_cb), NULL);
}
static void _enabler_proxy_init(void)
return ret;
}
-int companion_initialize()
+EXPORT_API int companion_initialize()
{
int ret = 0;
COMPANION_LOCK;
if (__is_initialized == false) {
- ret = _gdbus_initialize();
- __is_initialized = true;
+ ret = _gdbus_initialize();
+ __is_initialized = true;
}
ref_count++;
return ret;
}
-int companion_deinitialize()
+EXPORT_API int companion_deinitialize()
{
int ret = 0;
COMPANION_LOCK;
if (ref_count > 0)
- ref_count--;
+ ref_count--;
if (__is_initialized == true && ref_count == 0) {
- ret = _gdbus_deinitialize();
- __is_initialized = false;
+ ret = _gdbus_deinitialize();
+ __is_initialized = false;
}
COMPANION_UNLOCK;
}
-int companion_group_create(char *group_name)
+EXPORT_API int companion_group_create(char *group_name)
{
int ret = 0;
GError *error = NULL;
return ret;
}
-void companion_group_destroy(companion_group_t *group)
+EXPORT_API void companion_group_destroy(companion_group_t *group)
{
companion_check_null_ret("group", group);
group = NULL;
}
-int companion_group_find(int timeout, companion_group_found_cb found_cb,
+EXPORT_API int companion_group_find(int timeout, companion_group_found_cb found_cb,
companion_group_find_finish_cb finish_cb, void *user_data)
{
int ret = 0;
return ret;
}
-int companion_group_get_found_groups(companion_group_h **groups, int *count)
+EXPORT_API int companion_group_get_found_groups(companion_group_h **groups,
+ int *count)
{
int ret = 0;
GVariant *va = NULL;
return ret;
}
-int companion_group_join(companion_group_h group, companion_group_find_finish_cb callback, void *user_data)
+EXPORT_API int companion_group_join(companion_group_h group,
+ companion_group_find_finish_cb callback, void *user_data)
{
int ret = COMP_ERROR_NONE;
NOTUSED(group);
return ret;
}
-int companion_group_leave(companion_group_h group, companion_group_find_finish_cb callback, void *user_data)
+EXPORT_API int companion_group_leave(companion_group_h group,
+ companion_group_find_finish_cb callback, void *user_data)
{
int ret = COMP_ERROR_NONE;
NOTUSED(group);
return ret;
}
-int companion_device_find(int timeout, companion_device_found_cb found_cb,
+EXPORT_API int companion_device_find(int timeout, companion_device_found_cb found_cb,
companion_device_find_finish_cb finish_cb, void *user_data)
{
int ret = 0;
return ret;
}
-int companion_device_find_mowned_device(int timeout,
- companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb, void *user_data)
+EXPORT_API int companion_device_find_mowned_device(int timeout,
+ companion_device_found_cb found_cb, companion_device_find_finish_cb finish_cb,
+ void *user_data)
{
int ret = 0;
GError *error = NULL;
return ret;
}
-int companion_send_data(companion_device_h device, char *data, int len,
+EXPORT_API int companion_send_data(companion_device_h device, char *data, int len,
companion_send_data_finish_cb finish_cb, void *user_data)
{
int ret = COMP_ERROR_NONE;
return ret;
}
-/* companion_group_join : join to remote group. if group handle is my daemon's, then the api return fail error */
-int companion_device_get_found_devices(companion_device_h **devices, int *count)
+/* companion_group_join : join to remote group. if group handle is my daemon's,
+ then the api return fail error */
+EXPORT_API int companion_device_get_found_devices(companion_device_h **devices,
+ int *count)
{
int ret = 0;
int num = 0;
return ret;
}
-int companion_device_get_found_mowned_devices(
+EXPORT_API int companion_device_get_found_mowned_devices(
companion_device_h **devices, int *count)
{
int ret = 0;
return ret;
}
-int companion_device_get_my_device(companion_device_h *device)
+EXPORT_API int companion_device_get_my_device(companion_device_h *device)
{
int ret = 0;
GError *error = NULL;
device = NULL;
}
-int companion_device_get_my_uuid(char **uuid)
+EXPORT_API int companion_device_get_my_uuid(char **uuid)
{
int ret = 0;
GError *error = NULL;
}
/* group merge */
-int companion_group_merge(companion_group_h dest_group, companion_group_h src_group)
+EXPORT_API int companion_group_merge(companion_group_h dest_group,
+ companion_group_h src_group)
{
return 0;
}
-int companion_group_delete(companion_group_h group)
+EXPORT_API int companion_group_delete(companion_group_h group)
{
return 0;
}
-int companion_group_get_member_devices(companion_group_h group,
+EXPORT_API int companion_group_get_member_devices(companion_group_h group,
companion_device_h **devices, int *count)
{
return 0;
}
-int companion_device_invite(companion_group_h group,
- companion_device_h device, char *PIN, companion_device_invite_result_cb result_cb, void *user_data)
+EXPORT_API int companion_device_invite(companion_group_h group,
+ companion_device_h device, char *PIN, companion_device_invite_result_cb result_cb,
+ void *user_data)
{
int ret = 0;
GError *error = NULL;
device_invite_result_cb.result_cb = result_cb;
device_invite_result_cb.user_data = user_data;
- /* Now, for the sake of convenience, we change 'companion_device_invite' to 'group_call_invite_sync'. */
+ /* Now, for the sake of convenience, we change 'companion_device_invite' to
+ 'group_call_invite_sync'. */
#if 0
group_call_device_invite_sync(group_proxy, dev->device_id, PIN, &ret, NULL, &error);
#else
- group_call_invite_sync(group_proxy, grp->group_name, dev->device_id, PIN, &ret, NULL, &error);
+ group_call_invite_sync(group_proxy, grp->group_name, dev->device_id, PIN, &ret,
+ NULL, &error);
#endif
return ret;
}
-int companion_device_eject(companion_group_h group,
+EXPORT_API int companion_device_eject(companion_group_h group,
companion_device_h device, companion_device_eject_result_cb result_cb, void *user_data)
{
int ret = 0;
device_eject_result_cb.result_cb = result_cb;
device_eject_result_cb.user_data = user_data;
- /* Now, for the sake of convenience, we change 'companion_device_eject' to 'group_call_eject_sync'. */
+ /* Now, for the sake of convenience, we change 'companion_device_eject' to
+ 'group_call_eject_sync'. */
#if 0
group_call_device_eject_sync(group_proxy, dev->device_id, &ret, NULL, &error);
#else
return ret;
}
-int companion_group_information_create(companion_group_h* group)
+EXPORT_API int companion_group_information_create(companion_group_h* group)
{
companion_group_h _group = g_malloc0(sizeof(companion_group_t));
*group = _group;
return 0;
}
-int companion_group_information_clone(companion_group_h target,
+EXPORT_API int companion_group_information_clone(companion_group_h target,
companion_group_h source)
{
companion_group_t * dst = (companion_group_t *)target;
return 0;
}
-int companion_group_information_destroy(companion_group_h data)
+EXPORT_API int companion_group_information_destroy(companion_group_h data)
{
companion_group_t * group = (companion_group_t *)data;
return 0;
}
-int companion_group_information_get_type(companion_group_h group, companion_group_type_e *type)
+EXPORT_API int companion_group_information_get_type(companion_group_h group,
+ companion_group_type_e *type)
{
*type = ((companion_group_t *)group)->type;
return 0;
}
-int companion_group_information_get_resource_type(companion_group_h group, char **resource_type)
+EXPORT_API int companion_group_information_get_resource_type(
+ companion_group_h group, char **resource_type)
{
*resource_type = g_strdup(((companion_group_t *)group)->resource_type);
return 0;
}
-int companion_group_information_get_uri_path(companion_group_h group, char **uri_path)
+EXPORT_API int companion_group_information_get_uri_path(
+ companion_group_h group, char **uri_path)
{
*uri_path = g_strdup(((companion_group_t *)group)->uri_path);
return 0;
}
-int companion_group_information_get_name(companion_group_h group, char **name)
+EXPORT_API int companion_group_information_get_name(
+ companion_group_h group, char **name)
{
*name = g_strdup(((companion_group_t *)group)->group_name);
return 0;
}
-int companion_group_information_get_host_addr(companion_group_h group,
- char **host_addr)
+EXPORT_API int companion_group_information_get_host_addr
+ (companion_group_h group, char **host_addr)
{
*host_addr = g_strdup(((companion_group_t *)group)->host_addr);
return 0;
}
-int companion_device_information_create(companion_device_h* device)
+EXPORT_API int companion_device_information_create(companion_device_h* device)
{
companion_device_h _device = g_malloc0(sizeof(companion_device_t));
*device = _device;
return 0;
}
-int companion_device_information_clone(companion_device_h target,
+EXPORT_API int companion_device_information_clone(companion_device_h target,
companion_device_h source)
{
companion_device_t * dst = (companion_device_t *)target;
return 0;
}
-int companion_device_information_destroy(companion_device_h data)
+EXPORT_API int companion_device_information_destroy(companion_device_h data)
{
companion_device_t * device = (companion_device_t *)data;
return 0;
}
-int companion_device_information_get_device_id(companion_device_h device, char **device_id)
+EXPORT_API int companion_device_information_get_device_id(
+ companion_device_h device, char **device_id)
{
*device_id = g_strdup(((companion_device_t *)device)->device_id);
return 0;
}
-int companion_device_information_get_ip(companion_device_h device, char **ip)
+EXPORT_API int companion_device_information_get_ip(
+ companion_device_h device, char **ip)
{
*ip = g_strdup(((companion_device_t *)device)->ip);
return 0;
}
-int companion_device_information_get_device_type(companion_device_h device, char **device_type)
+EXPORT_API int companion_device_information_get_device_type(
+ companion_device_h device, char **device_type)
{
*device_type = g_strdup(((companion_device_t *)device)->device_type);
return 0;
}
-int companion_request_create_group(companion_device_h device, char *group_name)
+EXPORT_API int companion_request_create_group(companion_device_h device,
+ char *group_name)
{
int ret;
GError *error = NULL;
_DBG("Device id : %s", dev->device_id);
- group_call_request_create_group_sync(group_proxy, dev->device_id, group_name, &ret, NULL, &error);
+ group_call_request_create_group_sync(group_proxy, dev->device_id,
+ group_name, &ret, NULL, &error);
return ret;
}
-int companion_request_invite(companion_group_h group, companion_device_h device, char *PIN)
+EXPORT_API int companion_request_invite(companion_group_h group,
+ companion_device_h device, char *PIN)
{
int ret = 0;
_DBG("%s", grp->group_name);
_DBG("%s", dev->device_id);
- group_call_request_invite(group_proxy, grp->device_id, grp->group_name, dev->device_id, PIN,
+ group_call_request_invite(group_proxy, grp->device_id, grp->group_name,
+ dev->device_id, PIN,
NULL, NULL, NULL);
return ret;
}
-int companion_request_eject(companion_group_h group, companion_device_h device)
+EXPORT_API int companion_request_eject(companion_group_h group,
+ companion_device_h device)
{
int ret = 0;
return ret;
}
-int companion_request_delete_group(companion_group_h group)
+EXPORT_API int companion_request_delete_group(companion_group_h group)
{
int ret = 0;
return ret;
}
-int companion_request_result_callback(companion_request_result_cb result_cb, void *user_data)
+EXPORT_API int companion_request_result_callback(
+ companion_request_result_cb result_cb, void *user_data)
{
int ret = 0;
return ret;
}
-