*/
int bt_ipsp_unset_connection_state_changed_cb(void);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets the pbap connected status.
+ * @since_tizen 3.0
+ * @param[in] remote_address The address of the remote device
+ * @param[out] connected_status the connected status
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
+ * @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.
+ */
+int bt_pbap_client_is_connected(const char *address, bool *connected_status);
+
/**
* @}
*/
*/
int bt_ipsp_unset_connection_state_changed_cb(void);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets the pbap connected status.
+ * @since_tizen 3.0
+ * @param[in] remote_address The address of the remote device
+ * @param[out] connected_status the connected status
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
+ * @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.
+ */
+int bt_pbap_client_is_connected(const char *address, bool *connected_status);
+
/**
* @}
*/
*/
int bt_ipsp_unset_connection_state_changed_cb(void);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
+ * @brief Gets the pbap connected status.
+ * @since_tizen 3.0
+ * @param[in] remote_address The address of the remote device
+ * @param[out] connected_status the connected status
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
+ * @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.
+ */
+int bt_pbap_client_is_connected(const char *address, bool *connected_status);
+
/**
* @}
*/
return error_code;
}
+int bt_pbap_client_is_connected(const char *address, bool *connected_status)
+{
+ bluetooth_device_address_t addr_hex = { {0,} };
+ int ret;
+ gboolean is_connected = FALSE;
+
+ BT_CHECK_PBAP_CLIENT_SUPPORT();
+ BT_CHECK_INIT_STATUS();
+ BT_CHECK_INPUT_PARAMETER(address);
+
+ _bt_convert_address_to_hex(&addr_hex, address);
+
+ ret = _bt_get_error_code(bluetooth_is_device_connected(&addr_hex,
+ BLUETOOTH_PBAP_SERVICE, &is_connected));
+ *connected_status = is_connected ? true : false;
+
+ if (ret != BT_ERROR_NONE) {
+ BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); /* LCOV_EXCL_LINE */
+ return ret;
+ }
+
+ return ret;
+
+}
+
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)
{
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_CONNECT},
{"bt_pbap_client_disconnect()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_DISCONNECT},
+ {"bt_pbap_client_is_connected()"
+ , BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_IS_CONNECTED},
{"bt_pbap_client_get_phone_book_size()"
, BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE},
{"bt_pbap_client_get_phone_book()"
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
+ case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_IS_CONNECTED: {
+ bool connected_status = false;
+
+ ret = bt_pbap_client_is_connected(remote_addr, &connected_status);
+ if (ret < BT_ERROR_NONE)
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+
+ TC_PRT("PBAP Profile [%s]",
+ connected_status ? "Connected" : "Disconnected");
+ break;
+ }
case BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE: {
ret = bt_pbap_client_get_phone_book_size(remote_addr,
0, 0,
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_IS_CONNECTED,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_GETSIZE,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_PHONEBOOKPULL,
BT_UNIT_TEST_FUNCTION_PBAP_CLIENT_VCARDLIST,