*/
int bt_adapter_le_set_advertising_filter_policy(bt_advertiser_h advertiser, bt_adapter_le_advertising_filter_policy_e filter_policy);
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Retrieves the address of the devices connected with the specific profile.
+ * @since_tizen 2.3.1
+ *
+ * @param[in] profile_uuid The UUID of profile service uuid of the connected device
+ * @param [in] callback The callback function to invoke
+ * @param [in] user_data The user data passed from the foreach 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_OUT_OF_MEMORY Out of memory
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED There is no connected device
+ * @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.
+ * @post This function invokes bt_adapter_profile_connected_devices_cb().
+ *
+ * @see bt_adapter_profile_connected_devices_cb()
+ */
+int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid,
+ bt_adapter_profile_connected_devices_cb callback, void *user_data);
+
/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @file bluetooth_type_internal.h
*/
+#define BT_PROFILE_SERVICE_UUID_SPP "1101"
+#define BT_PROFILE_SERVICE_UUID_HSP_HS "1108"
+#define BT_PROFILE_SERVICE_UUID_HSP_AG "1112"
+#define BT_PROFILE_SERVICE_UUID_OPP "1105"
+#define BT_PROFILE_SERVICE_UUID_HFP_HF "111e"
+#define BT_PROFILE_SERVICE_UUID_HFP_AG "111f"
+#define BT_PROFILE_SERVICE_UUID_A2DP_SOURCE "110a"
+#define BT_PROFILE_SERVICE_UUID_A2DP_SINK "110b"
+#define BT_PROFILE_SERVICE_UUID_AVRCP_TARGET "110c"
+#define BT_PROFILE_SERVICE_UUID_AVRCP_CONTROL "110f"
+#define BT_PROFILE_SERVICE_UUID_PAN_PANU "1115"
+#define BT_PROFILE_SERVICE_UUID_PAN_NAP "1116"
+#define BT_PROFILE_SERVICE_UUID_PAN_GN "1117"
+#define BT_PROFILE_SERVICE_UUID_HDP_SOURCE "1401"
+#define BT_PROFILE_SERVICE_UUID_HDP_SINK "1402"
+#define BT_PROFILE_SERVICE_UUID_HID "1124"
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
* @brief Enumerations of the Bluetooth adapter le state.
*/
int bt_adapter_le_set_advertising_filter_policy(bt_advertiser_h advertiser, bt_adapter_le_advertising_filter_policy_e filter_policy);
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Retrieves the address of the devices connected with the specific profile.
+ * @since_tizen 2.3.1
+ *
+ * @param[in] profile_uuid The UUID of profile service uuid of the connected device
+ * @param [in] callback The callback function to invoke
+ * @param [in] user_data The user data passed from the foreach 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_OUT_OF_MEMORY Out of memory
+ * @retval #BT_ERROR_NOT_ENABLED Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED There is no connected device
+ * @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.
+ * @post This function invokes bt_adapter_profile_connected_devices_cb().
+ *
+ * @see bt_adapter_profile_connected_devices_cb()
+ */
+int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid,
+ bt_adapter_profile_connected_devices_cb callback, void *user_data);
+
/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @file bluetooth_type_internal.h
*/
+#define BT_PROFILE_SERVICE_UUID_SPP "1101"
+#define BT_PROFILE_SERVICE_UUID_HSP_HS "1108"
+#define BT_PROFILE_SERVICE_UUID_HSP_AG "1112"
+#define BT_PROFILE_SERVICE_UUID_OPP "1105"
+#define BT_PROFILE_SERVICE_UUID_HFP_HF "111e"
+#define BT_PROFILE_SERVICE_UUID_HFP_AG "111f"
+#define BT_PROFILE_SERVICE_UUID_A2DP_SOURCE "110a"
+#define BT_PROFILE_SERVICE_UUID_A2DP_SINK "110b"
+#define BT_PROFILE_SERVICE_UUID_AVRCP_TARGET "110c"
+#define BT_PROFILE_SERVICE_UUID_AVRCP_CONTROL "110f"
+#define BT_PROFILE_SERVICE_UUID_PAN_PANU "1115"
+#define BT_PROFILE_SERVICE_UUID_PAN_NAP "1116"
+#define BT_PROFILE_SERVICE_UUID_PAN_GN "1117"
+#define BT_PROFILE_SERVICE_UUID_HDP_SOURCE "1401"
+#define BT_PROFILE_SERVICE_UUID_HDP_SINK "1402"
+#define BT_PROFILE_SERVICE_UUID_HID "1124"
+
/* This variable will be added into bt_service_class_t in tizen 4.0 */
#define BT_SC_MAP_SERVICE_MASK 0x00800000 /**< MAP service class */
, BT_UNIT_TEST_FUNCTION_ADAPTER_IS_DISCOVERING},
{"bt_adapter_foreach_bonded_device"
, BT_UNIT_TEST_FUNCTION_ADAPTER_FOREACH_BONDED_DEVICE},
+ {"bt_adapter_foreach_profile_connected_devices"
+ , BT_UNIT_TEST_FUNCTION_ADAPTER_FOREACH_PROFILE_CONNECTED_DEVICES},
{"bt_adapter_get_bonded_device_info"
, BT_UNIT_TEST_FUNCTION_ADAPTER_GET_BONDED_DEVICE_INFO},
{"bt_adapter_is_service_used"
return true;
}
+static bool __bt_adapter_profile_connected_devices_cb(
+ const char *remote_address, void *user_data)
+{
+ TC_PRT("remote_address: %s", remote_address);
+
+ return true;
+}
+
static void __bt_adapter_device_discovery_state_changed_cb(
int result, bt_adapter_device_discovery_state_e discovery_state,
bt_adapter_device_discovery_info_s *discovery_info,
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
+ case BT_UNIT_TEST_FUNCTION_ADAPTER_FOREACH_PROFILE_CONNECTED_DEVICES: {
+ ret = bt_adapter_foreach_profile_connected_devices(BT_PROFILE_SERVICE_UUID_SPP,
+ __bt_adapter_profile_connected_devices_cb, NULL);
+ TC_PRT("SPP connected devices returns %s\n", __bt_get_error_message(ret));
+ ret = bt_adapter_foreach_profile_connected_devices(BT_PROFILE_SERVICE_UUID_HFP_HF,
+ __bt_adapter_profile_connected_devices_cb, NULL);
+ TC_PRT("HFP HF connected devices returns %s\n", __bt_get_error_message(ret));
+ ret = bt_adapter_foreach_profile_connected_devices(BT_PROFILE_SERVICE_UUID_A2DP_SOURCE,
+ __bt_adapter_profile_connected_devices_cb, NULL);
+ TC_PRT("A2DP Source connected devices returns %s\n", __bt_get_error_message(ret));
+ ret = bt_adapter_foreach_profile_connected_devices(BT_PROFILE_SERVICE_UUID_AVRCP_CONTROL,
+ __bt_adapter_profile_connected_devices_cb, NULL);
+ TC_PRT("AVRCP Control connected devices returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
case BT_UNIT_TEST_FUNCTION_ADAPTER_GET_BONDED_DEVICE_INFO: {
bt_device_info_s *device_info = NULL;
BT_UNIT_TEST_FUNCTION_ADAPTER_STOP_DEVICE_DISCOVERY,
BT_UNIT_TEST_FUNCTION_ADAPTER_IS_DISCOVERING,
BT_UNIT_TEST_FUNCTION_ADAPTER_FOREACH_BONDED_DEVICE,
+ BT_UNIT_TEST_FUNCTION_ADAPTER_FOREACH_PROFILE_CONNECTED_DEVICES,
BT_UNIT_TEST_FUNCTION_ADAPTER_GET_BONDED_DEVICE_INFO,
BT_UNIT_TEST_FUNCTION_ADAPTER_IS_SERVICE_USED,
BT_UNIT_TEST_FUNCTION_ADAPTER_GET_VISIBILITY,