mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/btdm_change_default_CoD_of_BT_profile' into 'master'
components/bt: Set default Class of Device of BT profile See merge request idf/esp-idf!3564
This commit is contained in:
commit
dba29eeb2e
@ -1870,8 +1870,14 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
|
|||||||
bta_av_cb.features = 0;
|
bta_av_cb.features = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear the Capturing service class bit */
|
/* Clear the Capturing/Rendering service class bit */
|
||||||
cod.service = BTM_COD_SERVICE_CAPTURING;
|
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||||
|
cod.service = BTM_COD_SERVICE_CAPTURING | BTM_COD_SERVICE_AUDIO;
|
||||||
|
} else {
|
||||||
|
#if (BTA_AV_SINK_INCLUDED == TRUE)
|
||||||
|
cod.service = BTM_COD_SERVICE_RENDERING | BTM_COD_SERVICE_AUDIO;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
utl_set_device_class(&cod, BTA_UTL_CLR_COD_SERVICE_CLASS);
|
utl_set_device_class(&cod, BTA_UTL_CLR_COD_SERVICE_CLASS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -577,15 +577,19 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the Capturing service class bit */
|
/* Set the Calss of Device (Audio & Capturing/Rendering service class bit) */
|
||||||
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
|
||||||
cod.service = BTM_COD_SERVICE_CAPTURING;
|
cod.service = BTM_COD_SERVICE_CAPTURING | BTM_COD_SERVICE_AUDIO;
|
||||||
|
cod.major = BTM_COD_MAJOR_AUDIO;
|
||||||
|
cod.minor = BTM_COD_MINOR_UNCLASSIFIED;
|
||||||
} else {
|
} else {
|
||||||
#if (BTA_AV_SINK_INCLUDED == TRUE)
|
#if (BTA_AV_SINK_INCLUDED == TRUE)
|
||||||
cod.service = BTM_COD_SERVICE_RENDERING;
|
cod.service = BTM_COD_SERVICE_RENDERING | BTM_COD_SERVICE_AUDIO;
|
||||||
|
cod.major = BTM_COD_MAJOR_AUDIO;
|
||||||
|
cod.minor = BTM_COD_MINOR_LOUDSPEAKER;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
utl_set_device_class(&cod, BTA_UTL_SET_COD_SERVICE_CLASS);
|
utl_set_device_class(&cod, BTA_UTL_SET_COD_ALL);
|
||||||
} /* if 1st channel */
|
} /* if 1st channel */
|
||||||
|
|
||||||
/* get stream configuration and create stream */
|
/* get stream configuration and create stream */
|
||||||
|
@ -73,9 +73,11 @@ void bta_hf_client_register(tBTA_HF_CLIENT_DATA *p_data)
|
|||||||
/* create SDP records */
|
/* create SDP records */
|
||||||
bta_hf_client_create_record(p_data);
|
bta_hf_client_create_record(p_data);
|
||||||
|
|
||||||
/* Set the Audio service class bit */
|
/* Set the Class of Device (Audio service class bit) */
|
||||||
cod.service = BTM_COD_SERVICE_AUDIO;
|
cod.service = BTM_COD_SERVICE_AUDIO;
|
||||||
utl_set_device_class(&cod, BTA_UTL_SET_COD_SERVICE_CLASS);
|
cod.major = BTM_COD_MAJOR_AUDIO;
|
||||||
|
cod.minor = BTM_COD_MINOR_CONFM_HANDSFREE;
|
||||||
|
utl_set_device_class(&cod, BTA_UTL_SET_COD_ALL);
|
||||||
|
|
||||||
/* start RFCOMM server */
|
/* start RFCOMM server */
|
||||||
bta_hf_client_start_server();
|
bta_hf_client_start_server();
|
||||||
@ -98,8 +100,14 @@ void bta_hf_client_register(tBTA_HF_CLIENT_DATA *p_data)
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void bta_hf_client_deregister(tBTA_HF_CLIENT_DATA *p_data)
|
void bta_hf_client_deregister(tBTA_HF_CLIENT_DATA *p_data)
|
||||||
{
|
{
|
||||||
|
tBTA_UTL_COD cod;
|
||||||
|
|
||||||
bta_hf_client_cb.scb.deregister = TRUE;
|
bta_hf_client_cb.scb.deregister = TRUE;
|
||||||
|
|
||||||
|
/* Clear the Audio service class bit */
|
||||||
|
cod.service = BTM_COD_SERVICE_AUDIO;
|
||||||
|
utl_set_device_class(&cod, BTA_UTL_CLR_COD_SERVICE_CLASS);
|
||||||
|
|
||||||
/* remove sdp record */
|
/* remove sdp record */
|
||||||
bta_hf_client_del_record(p_data);
|
bta_hf_client_del_record(p_data);
|
||||||
|
|
||||||
|
@ -643,10 +643,17 @@ BOOLEAN bta_jv_check_psm(UINT16 psm)
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void bta_jv_enable(tBTA_JV_MSG *p_data)
|
void bta_jv_enable(tBTA_JV_MSG *p_data)
|
||||||
{
|
{
|
||||||
|
tBTA_UTL_COD cod;
|
||||||
|
|
||||||
tBTA_JV_STATUS status = BTA_JV_SUCCESS;
|
tBTA_JV_STATUS status = BTA_JV_SUCCESS;
|
||||||
bta_jv_cb.p_dm_cback = p_data->enable.p_cback;
|
bta_jv_cb.p_dm_cback = p_data->enable.p_cback;
|
||||||
bta_jv_cb.p_dm_cback(BTA_JV_ENABLE_EVT, (tBTA_JV *)&status, 0);
|
bta_jv_cb.p_dm_cback(BTA_JV_ENABLE_EVT, (tBTA_JV *)&status, 0);
|
||||||
memset(bta_jv_cb.free_psm_list, 0, sizeof(bta_jv_cb.free_psm_list));
|
memset(bta_jv_cb.free_psm_list, 0, sizeof(bta_jv_cb.free_psm_list));
|
||||||
|
|
||||||
|
/* Set the Class of Device */
|
||||||
|
cod.major = BTM_COD_MAJOR_UNCLASSIFIED;
|
||||||
|
cod.minor = BTM_COD_MINOR_UNCLASSIFIED;
|
||||||
|
utl_set_device_class(&cod, BTA_UTL_SET_COD_MAJOR_MINOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -662,8 +669,6 @@ void bta_jv_enable(tBTA_JV_MSG *p_data)
|
|||||||
void bta_jv_disable (tBTA_JV_MSG *p_data)
|
void bta_jv_disable (tBTA_JV_MSG *p_data)
|
||||||
{
|
{
|
||||||
UNUSED(p_data);
|
UNUSED(p_data);
|
||||||
|
|
||||||
APPL_TRACE_ERROR("%s", __func__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -620,9 +620,18 @@
|
|||||||
*/
|
*/
|
||||||
#define BTA_DM_COD_LOUDSPEAKER {0x2C, 0x04, 0x14}
|
#define BTA_DM_COD_LOUDSPEAKER {0x2C, 0x04, 0x14}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
|
||||||
|
*
|
||||||
|
* SERVICE_CLASS:0x00 None
|
||||||
|
* MAJOR_CLASS:0x1f - Uncategorized: device code not specified
|
||||||
|
* MINOR_CLASS:0x00 - None
|
||||||
|
*/
|
||||||
|
#define BTA_DM_COD_UNCLASSIFIED {0x00, 0x1f, 0x00}
|
||||||
|
|
||||||
/* Default class of device */
|
/* Default class of device */
|
||||||
#ifndef BTA_DM_COD
|
#ifndef BTA_DM_COD
|
||||||
#define BTA_DM_COD BTA_DM_COD_LOUDSPEAKER
|
#define BTA_DM_COD BTA_DM_COD_UNCLASSIFIED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The number of SCO links. */
|
/* The number of SCO links. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user