int bt_gatt_unset_connection_state_changed_cb(void);
/**
- * @}
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Initializes the Bluetooth PBAP Client.
+ * @details This initialization is necessary to call other PBAP client APIs.
+ * @since_tizen 3.0
+ *
+ * @remarks This function must be called to initialize Bluetooth PBAP client. You must free all resources of the Bluetooth service
+ * by calling bt_pbap_client_deinitialize() if Bluetooth PBAP Client is no longer needed.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ *
+ * @see bt_pbap_client_deinitialize()
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ * @see bt_pbap_client_get_phone_book_size()
+ * @see bt_pbap_client_get_phone_book()
+ * @see bt_pbap_client_get_list()
+ * @see bt_pbap_client_pull_vcard()
+ * @see bt_pbap_client_search_phone_book()
+ */
+int bt_pbap_client_initialize(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Deinitializes the Bluetooth PBAP Client.
+ * @details This deinitialization must be done to free resources when the PBAP client is not longer needed.
+ * @since_tizen 3.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @see bt_pbap_client_deinitialize()
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ * @see bt_pbap_client_get_phone_book_size()
+ * @see bt_pbap_client_get_phone_book()
+ * @see bt_pbap_client_get_list()
+ * @see bt_pbap_client_pull_vcard()
+ * @see bt_pbap_client_search_phone_book()
+ */
+int bt_pbap_client_deinitialize(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Registers a callback function that will be invoked when the connection state is changed.
+ * @since_tizen 3.0
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @see bt_pbap_client_initialize()
*/
+int bt_pbap_client_set_connection_state_changed_cb(bt_pbap_connection_state_changed_cb callback, void *user_data);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Unregisters a callback function that will be invoked when the connection state is changed.
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @see bt_pbap_client_initialize()
+ */
+int bt_pbap_client_unset_connection_state_changed_cb(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Connects to PBAP server, asynchronously.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] address The other device's address
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre The local device must be bonded with the remote device by bt_device_create_bond().
+ * @post bt_pbap_connection_state_changed_cb() will be invoked.
+ * @see bt_pbap_client_disconnect()
+ * @see bt_pbap_client_set_connection_state_changed_cb()
+ */
+int bt_pbap_client_connect(const char *address);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Disconnects from PBAP server, asynchronously.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] address The other device's address
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ * @post bt_pbap_connection_state_changed_cb() will be invoked.
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_set_connection_state_changed_cb()
+ */
+int bt_pbap_client_disconnect(const char *address);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets size of phone book from PBAP server, asynchronously.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] address The other device's address
+ * @param[in] source Source of the phone book (Phone/SIM)
+ * @param[in] folder_type Type of folder
+ * @param[in] callback The callback function called when PBAP phone book size is returned.
+ * @param[in] user_data Data to be passed to the PBAP phone book size callback.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ *
+ * @see bt_pbap_client_connect()
+ */
+int bt_pbap_client_get_phone_book_size(const char *address,
+ bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type,
+ bt_pbap_phone_book_size_cb callback,
+ void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets all contacts and call logs as vCard from PBAP server, asynchronously.
+ * @details The received phone book file will be saved in the platform downloads folder.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ * http://tizen.org/privilege/mediastorage
+ *
+ * @param[in] address The other device's address
+ * @param[in] source Source of phone book (Phone/SIM)
+ * @param[in] folder_type Type of folder
+ * @param[in] format The vCard format
+ * @param[in] order Specifies which field shall be used to sort vCards.
+ * @param[in] offset The number of vCards to be excluded, counting from the beginning
+ * @param[in] max_list_count The maximum number of vCards to be fetched
+ * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
+ * @param[in] callback The callback function called when PBAP phone book is Pulled.
+ * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ *
+ * @see bt_pbap_client_connect()
+ */
+int bt_pbap_client_get_phone_book(const char *address,
+ bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type,
+ bt_pbap_vcard_format_e format,
+ bt_pbap_sort_order_e order,
+ unsigned short offset,
+ unsigned short max_list_count,
+ unsigned int fields,
+ bt_pbap_phone_book_received_cb callback,
+ void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets contact and call log information from the PBAP server, asynchronously.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] address The other device's address
+ * @param[in] source Source of phone book (Phone/SIM)
+ * @param[in] folder_type Type of folder
+ * @param[in] order Specifies which field shall be used to sort vCards.
+ * @param[in] offset vCards to be excluded from beginning.
+ * @param[in] max_list_count Maximum number of vCards to be fetched
+ * @param[in] callback The callback function called when PBAP List is returned.
+ * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ *
+ * @see bt_pbap_client_connect()
+ */
+int bt_pbap_client_get_list(const char *address,
+ bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type,
+ bt_pbap_sort_order_e order,
+ unsigned short offset,
+ unsigned short max_list_count,
+ bt_pbap_list_vcards_cb callback,
+ void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets the selected contact using the index parameter as vCard from PBAP server, asynchronously.
+ * @details The received phone book file will be saved in the platform downloads folder.
+ * The @a index value should be equal to the value of the @a index field in the #bt_pbap_vcard_info_s structure,
+ * which can be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ * http://tizen.org/privilege/mediastorage
+ *
+ * @param[in] address The other device's address
+ * @param[in] source Source of phone book (Phone/SIM)
+ * @param[in] folder_type Type of folder
+ * @param[in] index The handle index of vCard to be fetched
+ * @param[in] format Format of vCard
+ * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
+ * @param[in] callback The callback function called when PBAP phone book is Pulled.
+ * @param[in] user_data Data to be passed to the PBAP phone book Pulling callback.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ * @pre The vCard information (#bt_pbap_vcard_info_s) must be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_get_list()
+ * @see bt_pbap_client_search_phone_book()
+ */
+int bt_pbap_client_pull_vcard(const char *address,
+ bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type,
+ int index,
+ bt_pbap_vcard_format_e format,
+ unsigned int fields,
+ bt_pbap_phone_book_received_cb callback,
+ void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Finds and fetches the contact and call log information from the PBAP server, asynchronously.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] address The other device's address
+ * @param[in] source Source of phone book (Phone/SIM)
+ * @param[in] folder_type Type of folder
+ * @param[in] search_attribute field to be search
+ * @param[in] search_value pattern to be searched for
+ * @param[in] order Specifies which field shall be used to sort vCards.
+ * @param[in] offset vCards to be excluded from beginning.
+ * @param[in] max_list_count Maximum number of vCards to be fetched
+ * @param[in] callback The callback function called when PBAP List is returned.
+ * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
+ * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
+ * @pre PBAP connection must be created with bt_pbap_client_connect().
+ *
+ * @see bt_pbap_client_connect()
+ */
+int bt_pbap_search_phone_book(const char *address,
+ bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type,
+ bt_pbap_search_field_e search_attribute,
+ const char *search_value,
+ bt_pbap_sort_order_e order,
+ unsigned short offset,
+ unsigned short max_list_count,
+ bt_pbap_list_vcards_cb callback,
+ void *user_data);
+
+/**
+ * @}
+ */
#ifdef __cplusplus
}
int bt_hf_free_call_status_info_list(GSList *call_list);
/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Initializes the Bluetooth PBAP Client.
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @details Initializes the Bluetooth PBAP Client.
- * This initialization is necessary to call other PBAP client APIs.
- *
- * @remarks This function must be called to initiatize Bluetooth PBAP client. You must free all resources of the Bluetooth service
- * by calling bt_pbap_deinit() if Bluetooth PBAP Client is no longer needed.
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_NOT_ENABLED Not enabled
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- *
- * @see bt_pbap_deinit()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- * @see bt_pbap_get_phonebook_size()
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_get_list()
- * @see bt_pbap_pull_vcard()
- * @see bt_pbap_phonebook_search()
- */
-int bt_pbap_init(void);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief De-initializes the Bluetooth PBAP Client.
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @details De-Initializes the Bluetooth PBAP Client.
- * This deinitialization must be done to free resource when PBAP client is not longer needed.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_NOT_ENABLED Not enabled
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * @see bt_pbap_deinit()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- * @see bt_pbap_get_phonebook_size()
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_get_list()
- * @see bt_pbap_pull_vcard()
- * @see bt_pbap_phonebook_search()
- */
-int bt_pbap_deinit(void);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To connect to PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] Callback to be called when PBAP session is Connected.
- * @param[in] user_data Data to be passed to PBAP enabled/disabled callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_ALREADY_CONNECT PBAP client already connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * @see bt_pbap_disconnect()
- */
-int bt_pbap_connect(const char *address, bt_pbap_enabled_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To disconnect from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] Callback to be called when PBAP session is disconnected.
- * @param[in] user_data Data to be passed to PBAP enabled/disabled callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_disconnect(const char *address, bt_pbap_enabled_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To get size of phonebook from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] source Source of Phonebook (Phone/SIM)
- * @param[in] type Type of folder
- * @param[in] Callback to be called when PBAP Phonebook Size is Returned.
- * @param[in] user_data Data to be passed to the PBAP Phonebook Size callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_get_phonebook_size(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_phonebook_size_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To get contacts/call logs as vCards from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] source Source of Phonebook (Phone/SIM)
- * @param[in] type Type of folder
- * @param[in] format Format of vCard
- * @param[in] order Specifies which field shall be used to sort vCards.
- * @param[in] offset vCards to be excluded from beginning.
- * @param[in] maxlistcount Maximum number of vCards to be fetched
- * @param[in] fields Fields of vCard to be fetched.
- * @param[in] Callback to be called when PBAP Phonebook is Pulled.
- * @param[in] user_data Data to be passed to the PBAP Phonebook Pull callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_get_phonebook(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_filter_vcard_format_e format,
- bt_pbap_filter_sort_order_e order, unsigned short offset,
- unsigned short maxlistcount, long long unsigned fields,
- bt_pbap_phonebook_pull_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To get Contact or Call List from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] source Source of Phonebook (Phone/SIM)
- * @param[in] type Type of folder
- * @param[in] order Specifies which field shall be used to sort vCards.
- * @param[in] offset vCards to be excluded from beginning.
- * @param[in] maxlistcount Maximum number of vCards to be fetched
- * @param[in] Callback to be called when PBAP List is returned.
- * @param[in] user_data Data to be passed to the PBAP Phonebook Pull callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_get_list(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_filter_sort_order_e order,
- unsigned short offset, unsigned short maxlistcount,
- bt_pbap_list_vcards_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To get a contact/call log from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] source Source of Phonebook (Phone/SIM)
- * @param[in] type Type of folder
- * @param[in] index Handle of vCard to be fetched
- * @param[in] format Format of vCard
- * @param[in] fields Fields of vCard to be fetched.
- * @param[in] Callback to be called when PBAP Phonebook is Pulled.
- * @param[in] user_data Data to be passed to the PBAP Phonebook Pull callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_pull_vcard(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, int index,
- bt_pbap_filter_vcard_format_e format, long long unsigned fields,
- bt_pbap_get_vcard_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief To get Contact or Call List from PBAP server
- * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
- * @privlevel platform
- * @privilege http://tizen.org/privilege/bluetooth.admin
- *
- * @param[in] address The other device's address
- * @param[in] source Source of Phonebook (Phone/SIM)
- * @param[in] type Type of folder
- * @param[in] search_attribute field to be search
- * @param[in] search_value pattern to be searched for
- * @param[in] order Specifies which field shall be used to sort vCards.
- * @param[in] offset vCards to be excluded from beginning.
- * @param[in] maxlistcount Maximum number of vCards to be fetched
- * @param[in] Callback to be called when PBAP List is returned.
- * @param[in] user_data Data to be passed to the PBAP Phonebook Pull callback.
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
- * @retval #BLUETOOTH_ERROR_NOT_CONNECTED PBAP Client is not connected
- * @retval #BT_ERROR_OPERATION_FAILED Operation failed
- * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #BT_ERROR_NOT_SUPPORTED Not supported
- *
- * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
- * PBAP client must be initialized with bt_pbap_init()
- * PBAP connection must be created with bt_pbap_connect().
- *
- * @see bt_pbap_connect()
- */
-int bt_pbap_phonebook_search(const char *address,
- bt_pbap_addressbook_source_e source, bt_pbap_folder_type_e type,
- bt_pbap_search_field_e search_attribute, const char *search_value,
- bt_pbap_filter_sort_order_e order,
- unsigned short offset, unsigned short maxlistcount,
- bt_pbap_search_list_cb callback, void *user_data);
-
-/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
* @brief Gets the specification name from the UUID
/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of PBAP fields.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_FIELD_ALL = (0xFFFFFFFFU), /**< All field */
+ BT_PBAP_FIELD_VERSION = (1U << 0), /**< vCard Version */
+ BT_PBAP_FIELD_FN = (1U << 1), /**< Formatted Name */
+ BT_PBAP_FIELD_N = (1U << 2), /**< Structured Presentation of Name */
+ BT_PBAP_FIELD_PHOTO = (1U << 3), /**< Associated Image or Photo */
+ BT_PBAP_FIELD_BDAY = (1U << 4), /**< Birthday */
+ BT_PBAP_FIELD_ADR = (1U << 5), /**< Delivery Address */
+ BT_PBAP_FIELD_LABEL = (1U << 6), /**< Delivery */
+ BT_PBAP_FIELD_TEL = (1U << 7), /**< Telephone Number */
+ BT_PBAP_FIELD_EMAIL = (1U << 8), /**< Electronic Mail Address */
+ BT_PBAP_FIELD_MAILER = (1U << 9), /**< Electronic Mail */
+ BT_PBAP_FIELD_TZ = (1U << 10), /**< Time Zone */
+ BT_PBAP_FIELD_GEO = (1U << 11), /**< Geographic Position */
+ BT_PBAP_FIELD_TITLE = (1U << 12), /**< Job */
+ BT_PBAP_FIELD_ROLE = (1U << 13), /**< Role within the Organization */
+ BT_PBAP_FIELD_LOGO = (1U << 14), /**< Organization Logo */
+ BT_PBAP_FIELD_AGENT = (1U << 15), /**< vCard of Person Representing */
+ BT_PBAP_FIELD_ORG = (1U << 16), /**< Name of Organization */
+ BT_PBAP_FIELD_NOTE = (1U << 17), /**< Comments */
+ BT_PBAP_FIELD_REV = (1U << 18), /**< Revision */
+ BT_PBAP_FIELD_SOUND = (1U << 19), /**< Pronunciation of Name */
+ BT_PBAP_FIELD_URL = (1U << 20), /**< Uniform Resource Locator */
+ BT_PBAP_FIELD_UID = (1U << 21), /**< Unique ID */
+ BT_PBAP_FIELD_KEY = (1U << 22), /**< Public Encryption Key */
+ BT_PBAP_FIELD_NICKNAME = (1U << 23), /**< Nickname */
+ BT_PBAP_FIELD_CATEGORIES = (1U << 24), /**< Categories */
+ BT_PBAP_FIELD_PROID = (1U << 25), /**< Product ID */
+ BT_PBAP_FIELD_CLASS = (1U << 26), /**< Class information */
+ BT_PBAP_FIELD_SORT_STRING = (1U << 27), /**< String used for sorting operations */
+ BT_PBAP_FIELD_X_IRMC_CALL_DATETIME = (1U << 28), /**< Time stamp */
+} bt_pbap_field_e;
+
+/**
* @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
* @brief Enumerations of Bluetooth error codes.
* @since_tizen 2.3.1
} bt_panu_service_type_e;
/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of address book location for PBAP.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_SOURCE_DEVICE = 0x00, /**< Request for Addressbook from remote device */
+ BT_PBAP_SOURCE_SIM , /**< Request for address book from SIM */
+} bt_pbap_address_book_source_e;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of folder type.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_FOLDER_PHONE_BOOK = 0x00, /**< Request for address book */
+ BT_PBAP_FOLDER_INCOMING , /**< Request for incoming calls */
+ BT_PBAP_FOLDER_OUTGOING , /**< Request for outgoing calls */
+ BT_PBAP_FOLDER_MISSED , /**< Request for missed calls */
+ BT_PBAP_FOLDER_COMBINED , /**< Request for combined calls */
+} bt_pbap_folder_type_e;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of phone book search fields.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_SEARCH_NAME = 0x00, /**< Request for search by name (default) */
+ BT_PBAP_SEARCH_NUMBER, /**< Request for search by phone number */
+ BT_PBAP_SEARCH_SOUND, /**< Request for search by sound */
+} bt_pbap_search_field_e;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of vCard Formats.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_VCARD_FORMAT_VCARD21 = 0x00, /**< vCard format 2.1 (default) */
+ BT_PBAP_VCARD_FORMAT_VCARD30, /**< vCard format 3.0 */
+} bt_pbap_vcard_format_e;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Enumeration of sorting orders.
+ * @since_tizen 3.0
+ */
+typedef enum {
+ BT_PBAP_ORDER_INDEXED = 0x00, /**< Filter order indexed (default) */
+ BT_PBAP_ORDER_ALPHANUMERIC, /**< Filter order alphanumeric */
+ BT_PBAP_ORDER_PHONETIC, /**< Filter order phonetic */
+} bt_pbap_sort_order_e;
+
+/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief The handle to control Bluetooth LE advertising
* @since_tizen 2.3.1
typedef void (*bt_hid_device_data_received_cb)(const bt_hid_device_received_data_s *data, void *user_data);
/* HID device related type */
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief The structure type containing vCard information.
+ * @since_tizen 3.0
+ *
+ * @see bt_pbap_client_pull_vcard()
+ */
+typedef struct {
+ int index; /**< The vcard index, used as a parameter for bt_pbap_client_pull_vcard() */
+ const char *contact_name; /**< The contact name of the vCard */
+} bt_pbap_vcard_info_s;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Called when PBAP is Connected or Disconnected.
+ * @details The following error codes can be delivered: \n
+ * #BT_ERROR_NONE \n
+ * #BT_ERROR_OPERATION_FAILED \n
+ * @since_tizen 3.0
+ *
+ * @param[in] result The result of connecting to or disconnecting from the remote device
+ * @param[in] connected The PBAP connection status (@c true = connected, @c false = disconnected)
+ * @param[in] remote_address The remote device address (@a remote_address is valid only inside this function. To use outside the callback, make a copy. @a remote_address should not be freed.)
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ */
+typedef void (*bt_pbap_connection_state_changed_cb)(int result, bool connected,
+ const char *remote_address, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Called when PBAP Phonebook size calculation completes.
+ * @details The following error codes can be delivered: \n
+ * #BT_ERROR_NONE \n
+ * #BT_ERROR_OPERATION_FAILED \n
+ * @since_tizen 3.0
+ *
+ * @param[in] result The result of getting the phone book size
+ * @param[in] remote_address The remote device address (@a remote_address is valid only inside this function. To use outside the callback, make a copy. @a remote_address should not be freed.)
+ * @param[in] size Size of Phonebook
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_pbap_client_get_phone_book_size()
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ */
+typedef void (*bt_pbap_phone_book_size_cb)(int result, const char *remote_address,
+ int size, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Called when PBAP Phonebook Pull completes.
+ * @details The received phone book file will be saved in the platform downloads folder. \n
+ * The following error codes can be delivered: \n
+ * #BT_ERROR_NONE \n
+ * #BT_ERROR_OPERATION_FAILED \n
+ * @since_tizen 3.0
+ *
+ * @param[in] result The result of getting the phone book
+ * @param[in] remote_address The remote device address (@a remote_address is valid only inside this function. To use outside the callback, make a copy. @a remote_address should not be freed.)
+ * @param[in] vcf_file The absolute path of the file in which the vCards are saved (@a vcf_file is valid only inside this function. To use outside the callback, make a copy. @a vcf_file should not be freed.)
+ * @param[in] successful true if the operation was successful, false if not
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_pbap_client_get_phone_book()
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ */
+typedef void (*bt_pbap_phone_book_received_cb)(int result, const char *remote_address,
+ const char *vcf_file, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Called when PBAP List vCards completes.
+ * @details The following error codes can be delivered: \n
+ * #BT_ERROR_NONE \n
+ * #BT_ERROR_OPERATION_FAILED \n
+ * @since_tizen 3.0
+ *
+ * @param[in] result The result of getting the vcard list
+ * @param[in] remote_address The remote device address (@a remote_address is valid only inside this function. To use outside the callback, make a copy. @a remote_address should not be freed.)
+ * @param[in] vcard_info List of vcard information (@a vcard_info is valid only inside this function. To use outside the callback, make a copy. @a vcard_info should not be freed.)
+ * @param[in] count Number of contacts in the list
+ * @param[in] successful true if the operation was successful, false if not
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_pbap_client_get_list()
+ * @see bt_pbap_client_connect()
+ * @see bt_pbap_client_disconnect()
+ */
+typedef void (*bt_pbap_list_vcards_cb)(int result, const char *remote_address,
+ const bt_pbap_vcard_info_s *vcard_info, int count, void *user_data);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
*/
/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief definitions for PBAP fields.
- * @since_tizen 2.3
- */
-#define BT_PBAP_FIELD_ALL (0xFFFFFFFFFFFFFFFFULL)
-#define BT_PBAP_FIELD_VERSION (1ULL << 0)
-#define BT_PBAP_FIELD_FN (1ULL << 1)
-#define BT_PBAP_FIELD_N (1ULL << 2)
-#define BT_PBAP_FIELD_PHOTO (1ULL << 3)
-#define BT_PBAP_FIELD_BDAY (1ULL << 4)
-#define BT_PBAP_FIELD_ADR (1ULL << 5)
-#define BT_PBAP_FIELD_LABEL (1ULL << 6)
-#define BT_PBAP_FIELD_TEL (1ULL << 7)
-#define BT_PBAP_FIELD_EMAIL (1ULL << 8)
-#define BT_PBAP_FIELD_MAILER (1ULL << 9)
-#define BT_PBAP_FIELD_TZ (1ULL << 10)
-#define BT_PBAP_FIELD_GEO (1ULL << 11)
-#define BT_PBAP_FIELD_TITLE (1ULL << 12)
-#define BT_PBAP_FIELD_ROLE (1ULL << 13)
-#define BT_PBAP_FIELD_LOGO (1ULL << 14)
-#define BT_PBAP_FIELD_AGENT (1ULL << 15)
-#define BT_PBAP_FIELD_ORG (1ULL << 16)
-#define BT_PBAP_FIELD_NOTE (1ULL << 17)
-#define BT_PBAP_FIELD_REV (1ULL << 18)
-#define BT_PBAP_FIELD_SOUND (1ULL << 19)
-#define BT_PBAP_FIELD_URL (1ULL << 20)
-#define BT_PBAP_FIELD_UID (1ULL << 21)
-#define BT_PBAP_FIELD_KEY (1ULL << 22)
-#define BT_PBAP_FIELD_NICKNAME (1ULL << 23)
-#define BT_PBAP_FIELD_CATEGORIES (1ULL << 24)
-#define BT_PBAP_FIELD_PROID (1ULL << 25)
-#define BT_PBAP_FIELD_CLASS (1ULL << 26)
-#define BT_PBAP_FIELD_SORT_STRING (1ULL << 27)
-#define BT_PBAP_FIELD_X_IRMC_CALL_DATETIME (1ULL << 28)
-
-/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief Enumerations of the Bluetooth adapter le state.
* @since_tizen 2.3.1
} bt_hf_call_event_e;
/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Enumerations of Addressbook memory for PBAP.
- * @since_tizen 2.3
- */
-typedef enum {
- BT_PBAP_PHONE = 0x00, /**< Request for Addressbook from Phone*/
- BT_PBAP_SIM , /**< Request for Addressbook from SIM*/
-} bt_pbap_addressbook_source_e;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Enumerations of Folder type.
- * @since_tizen 2.3
- */
-typedef enum {
- BT_PBAP_PHONEBOOK = 0x00, /**< Request for Addressbook*/
- BT_PBAP_INCOMING , /**< Request for Incoming Calls*/
- BT_PBAP_OUTGOING , /**< Request for Outgoing Calls*/
- BT_PBAP_MISSED , /**< Request for Missed Calls*/
- BT_PBAP_COMBINED , /**< Request for Combined Calls*/
-} bt_pbap_folder_type_e;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Enumerations of Phonebook Search field.
- * @since_tizen 2.3
- */
-typedef enum {
- BT_PBAP_SEARCH_NAME = 0x00, /**< Request for Search by name (default)*/
- BT_PBAP_SEARCH_NUMBER, /**< Request for Search by phone number*/
- BT_PBAP_SEARCH_SOUND, /**< Request for Search by sound*/
-} bt_pbap_search_field_e;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Enumerations of vCard Formats.
- * @since_tizen 2.3
- */
-typedef enum {
- BT_PBAP_APP_PARAM_VCARD21 = 0x00, /**< vCard Format 2.1 (default)*/
- BT_PBAP_APP_PARAM_VCARD30, /**< vCard Format 3.0*/
-} bt_pbap_filter_vcard_format_e;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Enumerations of Sorting Orders.
- * @since_tizen 2.3
- */
-typedef enum {
- BT_PBAP_APP_PARAM_ORDER_INDEXED = 0x00, /**< Filter Order Indexed (default)*/
- BT_PBAP_APP_PARAM_ORDER_ALPHANUMERIC, /**< Filter Order Alphanumeric*/
- BT_PBAP_APP_PARAM_ORDER_PHONETIC, /**< Filter Order Phonetic*/
-} bt_pbap_filter_sort_order_e;
-
-/**
* @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
* @brief HF Call status information.
* @since_tizen 2.3
typedef void (*bt_hf_call_status_updated_event_cb) (GSList *call_info_list, void *user_data);
/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP is Connected or Disconnected.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] pbap_enabled PBAP connection status (@c 1 = enabled, @c 0 = disabled)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_enabled_cb)(const char *remote_address,
- int pbap_enabled, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP Phonebook Size is returned.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] size Size of Phonebook
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_get_phonebook_size()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_phonebook_size_cb)(const char *remote_address,
- int size, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP Phonebook Pull returns all contacts.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] vcf_file File in which vCards are saved
- * @param[in] status Status for successful Transfer (@c 0 = Unsuccessful, @c 1 = Successful)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_phonebook_pull_cb)(const char *remote_address,
- char *vcf_file, int status, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP List vCards returns the handles and Names.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] vcards List of vCards
- * @param[in] count Number of contacts in the list
- * @param[in] status Status for successful Transfer (@c 0 = Unsuccessful, @c 1 = Successful)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_list_vcards_cb)(const char *remote_address,
- char **vcards, int count, int status, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP Get vCard returns the contact.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] vcard Contact as vCard
- * @param[in] status Status for successful Transfer (@c 0 = Unsuccessful, @c 1 = Successful)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_get_vcard_cb)(const char *remote_address,
- char *vcard, int status, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
- * @brief Called when PBAP Phonebook Search returns the handles and Names.
- * @since_tizen 2.3
- *
- * @param[in] remote_address Remote Device address
- * @param[in] vcards List of vCards
- * @param[in] count Number of contacts in the list
- * @param[in] status Status for successful Transfer (@c 0 = Unsuccessful, @c 1 = Successful)
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_pbap_get_phonebook()
- * @see bt_pbap_connect()
- * @see bt_pbap_disconnect()
- */
-typedef void (*bt_pbap_search_list_cb)(const char *remote_address,
- char **vcards, int count, int status, void *user_data);
-
-/**
* @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
* @brief Enumerations of the attribute's permission
* @since_tizen 2.4
break;
#ifdef TIZEN_WEARABLE
case BLUETOOTH_PBAP_CONNECTED: {
- bt_pbap_enabled_cb cb = bt_event_slot_container[event_index].callback;
+ bt_pbap_connection_state_changed_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_connected_t *connected = (bt_pbap_connected_t *)param->param_data;
- BT_INFO("BLUETOOTH_PBAP_CONNECTED/DISCONNECTED");
- if (connected->connected == 0)
- _bt_unset_cb(BT_EVENT_PBAP_CONNECTION_STATUS);
+ BT_INFO("BLUETOOTH_PBAP_CONNECTED");
+
_bt_convert_address_to_string(&device_addr, &connected->btaddr);
- cb(device_addr, connected->connected, user_data);
+ cb(_bt_get_error_code(param->result), true, device_addr, user_data);
+
+ if (device_addr != NULL)
+ free(device_addr);
+
+ break;
+ }
+ case BLUETOOTH_PBAP_DISCONNECTED: {
+ bt_pbap_connection_state_changed_cb cb = bt_event_slot_container[event_index].callback;
+ void *user_data = bt_event_slot_container[event_index].user_data;
+ bt_pbap_connected_t *connected = (bt_pbap_connected_t *)param->param_data;
+
+ BT_INFO("BLUETOOTH_PBAP_DISCONNECTED");
+
+ _bt_convert_address_to_string(&device_addr, &connected->btaddr);
+ cb(_bt_get_error_code(param->result), false, device_addr, user_data);
if (device_addr != NULL)
free(device_addr);
break;
}
case BLUETOOTH_PBAP_PHONEBOOK_SIZE: {
- bt_pbap_phonebook_size_cb cb = bt_event_slot_container[event_index].callback;
+ bt_pbap_phone_book_size_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_phonebook_size_t *pb_size = (bt_pbap_phonebook_size_t *)param->param_data;
_bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_SIZE);
_bt_convert_address_to_string(&device_addr, &pb_size->btaddr);
- cb(device_addr, pb_size->size, user_data);
+ cb(_bt_get_error_code(param->result), device_addr, pb_size->size, user_data);
if (device_addr != NULL)
free(device_addr);
break;
}
case BLUETOOTH_PBAP_PHONEBOOK_PULL: {
- bt_pbap_phonebook_pull_cb cb = bt_event_slot_container[event_index].callback;
+ bt_pbap_phone_book_received_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_phonebook_pull_t *pb_pull = (bt_pbap_phonebook_pull_t *)(param->param_data);
_bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_PULL);
_bt_convert_address_to_string(&device_addr, &pb_pull->btaddr);
- cb(device_addr, pb_pull->vcf_file, pb_pull->success, user_data);
+ cb(_bt_get_error_code(param->result), device_addr,
+ (const char *)pb_pull->vcf_file, user_data);
if (device_addr != NULL)
free(device_addr);
bt_pbap_list_vcards_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_vcard_list_t *vc_list = (bt_pbap_vcard_list_t *)(param->param_data);
+ bt_pbap_vcard_info_s *vcard_info = NULL;
+
+ if (vc_list->length > 0)
+ vcard_info = g_malloc0(vc_list->length * sizeof(bt_pbap_vcard_info_s));
BT_INFO("BLUETOOTH_PBAP_VCARD_LIST");
_bt_unset_cb(BT_EVENT_PBAP_VCARD_LIST);
_bt_convert_address_to_string(&device_addr, &vc_list->btaddr);
- cb(device_addr, vc_list->vcards, vc_list->length, vc_list->success, user_data);
+ cb(_bt_get_error_code(param->result), device_addr,
+ (const bt_pbap_vcard_info_s *)vcard_info, vc_list->length,
+ user_data);
if (device_addr != NULL)
free(device_addr);
+ if (vcard_info != NULL)
+ free(vcard_info);
+
break;
}
case BLUETOOTH_PBAP_VCARD_PULL: {
- bt_pbap_get_vcard_cb cb = bt_event_slot_container[event_index].callback;
+ bt_pbap_phone_book_received_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_vcard_pull_t *vc_pull = (bt_pbap_vcard_pull_t *)(param->param_data);
_bt_unset_cb(BT_EVENT_PBAP_VCARD_PULL);
_bt_convert_address_to_string(&device_addr, &vc_pull->btaddr);
- cb(device_addr, vc_pull->vcf_file, vc_pull->success, user_data);
+ cb(_bt_get_error_code(param->result), device_addr,
+ (const char *)vc_pull->vcf_file, user_data);
if (device_addr != NULL)
free(device_addr);
break;
}
case BLUETOOTH_PBAP_PHONEBOOK_SEARCH: {
- bt_pbap_search_list_cb cb = bt_event_slot_container[event_index].callback;
+ bt_pbap_list_vcards_cb cb = bt_event_slot_container[event_index].callback;
void *user_data = bt_event_slot_container[event_index].user_data;
bt_pbap_phonebook_search_list_t *vc_list = (bt_pbap_phonebook_search_list_t *)(param->param_data);
+ bt_pbap_vcard_info_s *vcard_info = NULL;
+
+ if (vc_list->length > 0)
+ vcard_info = g_malloc0(vc_list->length * sizeof(bt_pbap_vcard_info_s));
BT_INFO("BLUETOOTH_PBAP_PHONEBOOK_SEARCH");
_bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_SEARCH);
_bt_convert_address_to_string(&device_addr, &vc_list->btaddr);
- cb(device_addr, vc_list->vcards, vc_list->length, vc_list->success, user_data);
+ cb(_bt_get_error_code(param->result), device_addr,
+ (const bt_pbap_vcard_info_s *)vcard_info, vc_list->length,
+ user_data);
if (device_addr != NULL)
free(device_addr);
+ if (vcard_info != NULL)
+ free(vcard_info);
+
break;
}
case BLUETOOTH_EVENT_HF_CONNECTED:
return BT_EVENT_LE_DATA_LENGTH_CHANGED; /* LCOV_EXCL_LINE */
#ifdef TIZEN_WEARABLE
case BLUETOOTH_PBAP_CONNECTED:
+ case BLUETOOTH_PBAP_DISCONNECTED:
return BT_EVENT_PBAP_CONNECTION_STATUS;
case BLUETOOTH_PBAP_PHONEBOOK_SIZE:
return BT_EVENT_PBAP_PHONEBOOK_SIZE;
#define BT_CHECK_PBAP_SUPPORT()
#endif
-int bt_pbap_init(void)
+int bt_pbap_client_initialize(void)
{
BT_CHECK_PBAP_SUPPORT();
BT_CHECK_INIT_STATUS();
return error_code;
}
-int bt_pbap_deinit(void)
+int bt_pbap_client_deinitialize(void)
{
BT_CHECK_PBAP_SUPPORT();
BT_CHECK_INIT_STATUS();
return error_code;
}
-int bt_pbap_connect(const char *address, bt_pbap_enabled_cb callback, void *user_data)
+int bt_pbap_client_set_connection_state_changed_cb(bt_pbap_connection_state_changed_cb callback, void *user_data)
+{
+ BT_CHECK_PBAP_SUPPORT();
+ BT_CHECK_INIT_STATUS();
+ BT_CHECK_INPUT_PARAMETER(callback);
+ _bt_set_cb(BT_EVENT_PBAP_CONNECTION_STATUS, callback, user_data);
+ return BT_ERROR_NONE;
+
+}
+int bt_pbap_client_unset_connection_state_changed_cb(void)
+{
+ BT_CHECK_PBAP_SUPPORT();
+ BT_CHECK_INIT_STATUS();
+ if (_bt_check_cb(BT_EVENT_PBAP_CONNECTION_STATUS) == true)
+ _bt_unset_cb(BT_EVENT_PBAP_CONNECTION_STATUS);
+ return BT_ERROR_NONE;
+}
+
+int bt_pbap_client_connect(const char *address)
{
bluetooth_device_address_t addr_hex = { {0,} };
int error_code = BT_ERROR_NONE;
BT_CHECK_PBAP_SUPPORT();
BT_CHECK_INIT_STATUS();
BT_CHECK_INPUT_PARAMETER(address);
- BT_CHECK_INPUT_PARAMETER(callback);
_bt_convert_address_to_hex(&addr_hex, address);
- _bt_set_cb(BT_EVENT_PBAP_CONNECTION_STATUS, callback, user_data);
error_code = _bt_get_error_code(bluetooth_pbap_connect(&addr_hex));
if (error_code != BT_ERROR_NONE) {
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
- _bt_unset_cb(BT_EVENT_PBAP_CONNECTION_STATUS);
}
return error_code;
}
-int bt_pbap_disconnect(const char *address, bt_pbap_enabled_cb callback, void *user_data)
+int bt_pbap_client_disconnect(const char *address)
{
bluetooth_device_address_t addr_hex = { {0,} };
int error_code = BT_ERROR_NONE;
BT_CHECK_PBAP_SUPPORT();
BT_CHECK_INIT_STATUS();
BT_CHECK_INPUT_PARAMETER(address);
- BT_CHECK_INPUT_PARAMETER(callback);
_bt_convert_address_to_hex(&addr_hex, address);
- _bt_set_cb(BT_EVENT_PBAP_CONNECTION_STATUS, callback, user_data);
error_code = _bt_get_error_code(bluetooth_pbap_disconnect(&addr_hex));
if (error_code != BT_ERROR_NONE) {
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
- _bt_unset_cb(BT_EVENT_PBAP_CONNECTION_STATUS);
}
return error_code;
}
-int bt_pbap_get_phonebook_size(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_phonebook_size_cb callback, void *user_data)
+int bt_pbap_client_get_phone_book_size(const char *address, bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type, bt_pbap_phone_book_size_cb callback, void *user_data)
{
bluetooth_device_address_t addr_hex = { {0,} };
bt_pbap_folder_t folder = { 0, };
BT_CHECK_INPUT_PARAMETER(callback);
folder.addressbook = source;
- folder.folder_type = type;
+ folder.folder_type = folder_type;
_bt_convert_address_to_hex(&addr_hex, address);
_bt_set_cb(BT_EVENT_PBAP_PHONEBOOK_SIZE, callback, user_data);
error_code = _bt_get_error_code(bluetooth_pbap_get_phonebook_size(&addr_hex, &folder));
return error_code;
}
-int bt_pbap_get_phonebook(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_filter_vcard_format_e format,
- bt_pbap_filter_sort_order_e order, unsigned short offset,
- unsigned short maxlistcount, long long unsigned fields,
- bt_pbap_phonebook_pull_cb callback, void *user_data)
+int bt_pbap_client_get_phone_book(const char *address, bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type, bt_pbap_vcard_format_e format,
+ bt_pbap_sort_order_e order, unsigned short offset,
+ unsigned short max_list_count, unsigned int fields,
+ bt_pbap_phone_book_received_cb callback, void *user_data)
{
bluetooth_device_address_t addr_hex = { {0,} };
bt_pbap_pull_parameters_t app_param = { 0, };
BT_CHECK_INPUT_PARAMETER(callback);
/* To get size of phonebook, a separate API is provided
- * Hence, passing maxlistcount as 0 is restricted. */
- if (maxlistcount <= 0)
+ * Hence, passing max_list_count as 0 is restricted. */
+ if (max_list_count <= 0)
return BT_ERROR_INVALID_PARAMETER;
/* Maximum value of maxlistcount is 65535 */
- if (maxlistcount > 65535)
- maxlistcount = 65535;
+ if (max_list_count > 65535)
+ max_list_count = 65535;
app_param.format = format;
app_param.order = order;
app_param.offset = offset;
- app_param.maxlist = maxlistcount;
+ app_param.maxlist = max_list_count;
app_param.fields = fields;
folder.addressbook = source;
- folder.folder_type = type;
+ folder.folder_type = folder_type;
_bt_convert_address_to_hex(&addr_hex, address);
_bt_set_cb(BT_EVENT_PBAP_PHONEBOOK_PULL, callback, user_data);
return error_code;
}
-int bt_pbap_get_list(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, bt_pbap_filter_sort_order_e order,
- unsigned short offset, unsigned short maxlistcount,
+int bt_pbap_client_get_list(const char *address, bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type, bt_pbap_sort_order_e order,
+ unsigned short offset, unsigned short max_list_count,
bt_pbap_list_vcards_cb callback, void *user_data)
{
bluetooth_device_address_t addr_hex = { {0,} };
_bt_convert_address_to_hex(&addr_hex, address);
app_param.order = order;
app_param.offset = offset;
- app_param.maxlist = maxlistcount;
+ app_param.maxlist = max_list_count;
folder.addressbook = source;
- folder.folder_type = type;
+ folder.folder_type = folder_type;
_bt_set_cb(BT_EVENT_PBAP_VCARD_LIST, callback, user_data);
error_code = _bt_get_error_code(bluetooth_pbap_get_list(&addr_hex, &folder, &app_param));
return error_code;
}
-int bt_pbap_pull_vcard(const char *address, bt_pbap_addressbook_source_e source,
- bt_pbap_folder_type_e type, int index,
- bt_pbap_filter_vcard_format_e format, long long unsigned fields,
- bt_pbap_get_vcard_cb callback, void *user_data)
+int bt_pbap_client_pull_vcard(const char *address, bt_pbap_address_book_source_e source,
+ bt_pbap_folder_type_e folder_type, int index,
+ bt_pbap_vcard_format_e format, unsigned int fields,
+ bt_pbap_phone_book_received_cb callback, void *user_data)
{
bluetooth_device_address_t addr_hex = { {0,} };
bt_pbap_pull_vcard_parameters_t app_param = { 0, };
app_param.index = index;
folder.addressbook = source;
- folder.folder_type = type;
+ folder.folder_type = folder_type;
_bt_set_cb(BT_EVENT_PBAP_VCARD_PULL, callback, user_data);
error_code = _bt_get_error_code(bluetooth_pbap_pull_vcard(&addr_hex, &folder, &app_param));
return error_code;
}
-int bt_pbap_phonebook_search(const char *address,
- bt_pbap_addressbook_source_e source, bt_pbap_folder_type_e type,
+int bt_pbap_client_search_phone_book(const char *address,
+ bt_pbap_address_book_source_e source, bt_pbap_folder_type_e folder_type,
bt_pbap_search_field_e search_attribute, const char *search_value,
- bt_pbap_filter_sort_order_e order,
- unsigned short offset, unsigned short maxlistcount,
- bt_pbap_search_list_cb callback, void *user_data)
+ bt_pbap_sort_order_e order,
+ unsigned short offset, unsigned short max_list_count,
+ bt_pbap_list_vcards_cb callback, void *user_data)
{
bluetooth_device_address_t addr_hex = { {0,} };
bt_pbap_folder_t folder = { 0, };
_bt_convert_address_to_hex(&addr_hex, address);
folder.addressbook = source;
- folder.folder_type = type;
+ folder.folder_type = folder_type;
app_param.order = order;
app_param.offset = offset;
- app_param.maxlist = maxlistcount;
+ app_param.maxlist = max_list_count;
app_param.search_attribute = search_attribute;
strncpy(app_param.search_value, search_value,
BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH - 1);
/* PBAP Functions*/
{"BACK"
, BT_UNIT_TEST_FUNCTION_BACK},
- {"bt_pbap_init()"
+ {"bt_pbap_client_initialize()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_INITIALIZE},
- {"bt_pbap_deinit()"
+ {"bt_pbap_client_deinitialize()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DEINITIALIZE},
- {"bt_pbap_connect()"
+ {"bt_pbap_client_set_connection_state_changed_cb()"
+ , BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_SET_CONNECTION_STATE_CHANGED_CB},
+ {"bt_pbap_client_unset_connection_state_changed_cb()"
+ , BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_UNSET_CONNECTION_STATE_CHANGED_CB},
+ {"bt_pbap_client_connect()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_CONNECT},
- {"bt_pbap_disconnect()"
+ {"bt_pbap_client_disconnect()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DISCONNECT},
- {"bt_pbap_get_phonebook_size()"
+ {"bt_pbap_client_get_phone_book_size()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE},
- {"bt_pbap_get_phonebook()"
+ {"bt_pbap_client_get_phone_book()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKPULL},
- {"bt_pbap_get_list()"
+ {"bt_pbap_client_get_list()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST},
- {"bt_pbap_pull_vcard()"
+ {"bt_pbap_client_pull_vcard()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDPULL},
- {"bt_pbap_phonebook_search()"
+ {"bt_pbap_client_search_phone_book()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKSEARCH},
- {"bt_pbap_get_list() Maxlist=0"
+ {"bt_pbap_client_get_list() Maxlist=0"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST_MAXLIST_ZERO},
{"Select this menu to set parameters and then select the function again."
, BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
TC_PRT("Gain= %d", gain);
}
-void __bt_pbap_enabled_cb(const char *remote_address,
- int pbap_enabled, void *user_data)
+void __bt_pbap_connection_state_changed_cb(int result, bool connected, const char *remote_address, void *user_data)
{
- TC_PRT("__bt_pbap_enabled_cb");
+ TC_PRT("__bt_pbap_connection_state_changed_cb");
+ TC_PRT("Result: %d", result);
TC_PRT("Remote Device: %s", remote_address);
- TC_PRT("Connected Status: %d", pbap_enabled);
+ TC_PRT("Connected Status: %d", connected);
}
-void __bt_pbap_phonebook_size_cb(const char *remote_address,
+void __bt_pbap_phonebook_size_cb(int result, const char *remote_address,
int size, void *user_data)
{
TC_PRT("__bt_pbap_phonebook_size_cb");
+ TC_PRT("Result: %d", result);
TC_PRT("Remote Device: %s", remote_address);
TC_PRT("Phonebook Size: %d", size);
}
-void __bt_pbap_phonebook_pull_cb(const char *remote_address,
- char *vcf_file, int status, void *user_data)
+void __bt_pbap_phonebook_pull_cb(int result, const char *remote_address,
+ const char *vcf_file, void *user_data)
{
TC_PRT("__bt_pbap_phonebook_pull_cb");
+ TC_PRT("Result: %d", result);
TC_PRT("Remote Device: %s", remote_address);
TC_PRT("Phonebook Download File: %s", vcf_file);
TC_PRT("Phonebook Download Status: %s",
- status ? "Successful" : "Unsuccessful");
+ (result == BT_ERROR_NONE) ? "Successful" : "Unsuccessful");
}
-void __bt_pbap_vcard_list_cb(const char *remote_address,
- char **vcards, int count, int status, void *user_data)
+void __bt_pbap_vcard_list_cb(int result, const char *remote_address,
+ const bt_pbap_vcard_info_s *vcard_info, int count, void *user_data)
{
+ int i;
+
TC_PRT("__bt_pbap_vcard_list_cb");
+ TC_PRT("Result: %d", result);
TC_PRT("Remote Device: %s", remote_address);
- TC_PRT("vCard List: %s", vcards[0]);
TC_PRT("vCard Count: %d", count);
- TC_PRT("Listing Status: %s", status ? "Successful" : "Unsuccessful");
+
+ for (i = 0; i <count; i++)
+ TC_PRT("vCard[%d]: %s", vcard_info[i].index, vcard_info[i].contact_name);
+
+ TC_PRT("Listing Status: %s",
+ (result == BT_ERROR_NONE) ? "Successful" : "Unsuccessful");
}
#endif
__bt_adapter_le_device_discovery_state_changed_cb, NULL);
if (ret != BT_ERROR_NONE)
TC_PRT("returns %s\n", __bt_get_error_message(ret));
+#else
+ ret = bt_pbap_client_set_connection_state_changed_cb(__bt_pbap_connection_state_changed_cb,
+ NULL);
+ if (ret != BT_ERROR_NONE)
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
#endif
ret = bt_socket_set_connection_state_changed_cb(
__bt_socket_connection_state_changed_cb, NULL);
__bt_adapter_le_state_changed_cb, NULL);
if (ret != BT_ERROR_NONE)
TC_PRT("returns %s\n", __bt_get_error_message(ret));
+
return;
}
/*PBAP Test Cases */
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_INITIALIZE:
- ret = bt_pbap_init();
+ ret = bt_pbap_client_initialize();
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DEINITIALIZE:
- ret = bt_pbap_deinit();
+ ret = bt_pbap_client_deinitialize();
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
+ case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_SET_CONNECTION_STATE_CHANGED_CB: {
+ ret = bt_pbap_client_set_connection_state_changed_cb(__bt_pbap_connection_state_changed_cb,
+ NULL);
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+ case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_UNSET_CONNECTION_STATE_CHANGED_CB: {
+ ret = bt_pbap_client_unset_connection_state_changed_cb();
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_CONNECT: {
- ret = bt_pbap_connect(remote_addr,
- __bt_pbap_enabled_cb, NULL);
+ ret = bt_pbap_client_connect(remote_addr);
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DISCONNECT: {
- ret = bt_pbap_disconnect(remote_addr,
- __bt_pbap_enabled_cb, NULL);
+ ret = bt_pbap_client_disconnect(remote_addr);
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE: {
- ret = bt_pbap_get_phonebook_size(remote_addr,
+ ret = bt_pbap_client_get_phone_book_size(remote_addr,
0, 0,
__bt_pbap_phonebook_size_cb,
NULL);
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKPULL: {
- long long unsigned fields = BT_PBAP_FIELD_PHOTO | BT_PBAP_FIELD_EMAIL | BT_PBAP_FIELD_ORG;
- ret = bt_pbap_get_phonebook(remote_addr,
+ unsigned int fields = BT_PBAP_FIELD_PHOTO | BT_PBAP_FIELD_EMAIL | BT_PBAP_FIELD_ORG | BT_PBAP_FIELD_X_IRMC_CALL_DATETIME;
+
+ ret = bt_pbap_client_get_phone_book(remote_addr,
0, 0, 0, 0, 0, 100,
fields, __bt_pbap_phonebook_pull_cb,
NULL);
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST: {
- ret = bt_pbap_get_list(remote_addr,
+ ret = bt_pbap_client_get_list(remote_addr,
0, 0, 0, 0, 100,
__bt_pbap_vcard_list_cb,
NULL);
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDPULL: {
long long unsigned fields = BT_PBAP_FIELD_PHOTO | BT_PBAP_FIELD_EMAIL | BT_PBAP_FIELD_ORG;
- ret = bt_pbap_pull_vcard(remote_addr,
+ ret = bt_pbap_client_pull_vcard(remote_addr,
0, 0, 0, 0, fields,
__bt_pbap_phonebook_pull_cb,
NULL);
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKSEARCH: {
- ret = bt_pbap_phonebook_search(remote_addr,
+ ret = bt_pbap_client_search_phone_book(remote_addr,
0, 0,
- 0, "abc",
+ 0, "ff",
0, 0, 100,
__bt_pbap_vcard_list_cb,
NULL);
break;
}
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST_MAXLIST_ZERO: {
- ret = bt_pbap_get_list(remote_addr,
+ ret = bt_pbap_client_get_list(remote_addr,
0, 0, 0, 0, 0,
__bt_pbap_vcard_list_cb,
NULL);
BT_UNIT_TEST_FUNCTION_HF_UNSET_VENDOR_CMD_EVENT_CB,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_INITIALIZE = 1,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DEINITIALIZE,
+ BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_SET_CONNECTION_STATE_CHANGED_CB,
+ BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_UNSET_CONNECTION_STATE_CHANGED_CB,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_CONNECT,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DISCONNECT,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE,