*/
int bt_ag_is_connected(bool *connected);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
+ * @brief Switch between the connected headsets for AG role.
+ * @since_tizen 3.0
+ * @param[out]
+ * @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_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Not connected
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ */
+int bt_ag_switch_headset(const char *remote_addr);
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_A2DP_MODULE
* @brief Sets copy protection. streaming application that needs to have the copy protection for the streaming data, shall invoke this API.
*/
int bt_ag_is_connected(bool *connected);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
+ * @brief Switch between the connected headsets for AG role.
+ * @since_tizen 3.0
+ * @param[out]
+ * @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_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Not connected
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ */
+int bt_ag_switch_headset(const char *remote_addr);
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_A2DP_MODULE
* @brief Sets copy protection. streaming application that needs to have the copy protection for the streaming data, shall invoke this API.
*/
int bt_ag_is_connected(bool *connected);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
+ * @brief Switch between the connected headsets for AG role.
+ * @since_tizen 3.0
+ * @param[out]
+ * @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_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Not connected
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ */
+int bt_ag_switch_headset(const char *remote_addr);
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
* @brief Registers a callback function that will be invoked when the SCO(Synchronous Connection Oriented link) state is changed.
return error;
}
+int bt_ag_switch_headset(const char *remote_addr)
+{
+ int error;
+
+ BT_CHECK_HFP_SUPPORT();
+ BT_CHECK_INIT_STATUS();
+ BT_CHECK_AG_INIT_STATUS();
+ BT_CHECK_INPUT_PARAMETER(remote_addr);
+
+ char *addr = g_strdup(remote_addr);
+ BT_INFO("Remote address = %s", addr);
+
+ error = bluetooth_telephony_set_active_headset(addr);
+ error = _bt_get_error_code(error);
+
+ if (error != BT_ERROR_NONE)
+ BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
+
+ return error;
+}
+
int bt_call_list_create(bt_call_list_h *list)
{
call_list_s *handle;
, BT_UNIT_TEST_FUNCTION_AG_SET_CALL_HANDLING_EVENT_CB},
{"bt_ag_is_nrec_enabled"
, BT_UNIT_TEST_FUNCTION_AG_IS_NREC_ENABLED},
+ {"bt_ag_switch_headset"
+ , BT_UNIT_TEST_FUNCTION_AG_SWITCH_HEADSET},
/* A2DP SCMS-T functions */
{"Select this menu to set parameters and then select the function again."
break;
}
+ case BT_UNIT_TEST_FUNCTION_AG_SWITCH_HEADSET: {
+ if (param_index == 0) {
+ g_test_param.param_count = 1;
+ g_test_param.params = g_malloc0(sizeof(char *) *g_test_param.param_count);
+ param_type = BT_UNIT_TEST_PARAM_TYPE_STRING;
+ }
+
+ if (param_index > 0) {
+ g_test_param.params[param_index - 1] = g_malloc0(strlen(param) + 1);
+ strncpy(g_test_param.params[param_index - 1], param, strlen(param));
+ }
+
+ if (param_index == g_test_param.param_count) {
+ need_to_set_params = false;
+#ifdef ARCH64
+ test_input_callback((void *)(uintptr_t)test_id);
+#else
+ test_input_callback((void *)test_id);
+#endif
+ param_index = 0;
+ return 0;
+ }
+
+ TC_PRT("Input param(%d) type:%s",
+ param_index + 1, param_type);
+ param_index++;
+
+ break;
+ }
default:
TC_PRT("There is no param to set\n");
TC_PRT("returns %s\n", __bt_get_error_message(ret));
break;
}
+ case BT_UNIT_TEST_FUNCTION_AG_SWITCH_HEADSET: {
+ if (g_test_param.param_count < 0) {
+ TC_PRT("Input parameters first");
+ break;
+ }
+
+ ret = bt_ag_switch_headset(g_test_param.params[0]);
+ __bt_free_test_param(&g_test_param);
+
+ TC_PRT("returns %s\n", __bt_get_error_message(ret));
+ break;
+ }
+
case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
need_to_set_params = true;
TC_PRT("Select the function again");
BT_UNIT_TEST_FUNCTION_AG_NOTIFY_CALL_LIST,
BT_UNIT_TEST_FUNCTION_AG_SET_CALL_HANDLING_EVENT_CB,
BT_UNIT_TEST_FUNCTION_AG_IS_NREC_ENABLED,
+ BT_UNIT_TEST_FUNCTION_AG_SWITCH_HEADSET,
BT_UNIT_TEST_FUNCTION_AG_IS_WBS_MODE,
BT_UNIT_TEST_FUNCTION_AG_SET_VENDOR_CMD_CB,
BT_UNIT_TEST_FUNCTION_AG_UNSET_VENDOR_CMD_CB,