mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Bugfix for HFP and some Github issue.
1. Bugfix for AG audio crash (change the return position) 2. Fix the error macro name and error return in hfp_hf demo 3. Fix the annotation error using UTF-8 ' (from Github) 4. Change or remove the log in SCO related code region. 5. Correct error of introduction of a function.
This commit is contained in:
@@ -212,7 +212,7 @@ static void bta_hf_client_sco_conn_rsp(tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
|
|||||||
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
#if (BTM_SCO_HCI_INCLUDED == TRUE )
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_ag_ci_sco_data
|
** Function bta_hf_client_ci_sco_data
|
||||||
**
|
**
|
||||||
** Description Process the SCO data ready callin event
|
** Description Process the SCO data ready callin event
|
||||||
**
|
**
|
||||||
@@ -337,7 +337,7 @@ static void bta_hf_client_sco_disc_cback(UINT16 sco_idx)
|
|||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_hf_client_create_sco
|
** Function bta_hf_client_sco_create
|
||||||
**
|
**
|
||||||
** Description
|
** Description
|
||||||
**
|
**
|
||||||
|
@@ -203,7 +203,6 @@ bt_status_t btc_hf_client_connect( bt_bdaddr_t *bd_addr )
|
|||||||
BTC_TRACE_EVENT("HFP Client version is %s", btc_hf_client_version);
|
BTC_TRACE_EVENT("HFP Client version is %s", btc_hf_client_version);
|
||||||
CHECK_HF_CLIENT_INIT();
|
CHECK_HF_CLIENT_INIT();
|
||||||
return btc_queue_connect(UUID_SERVCLASS_HF_HANDSFREE, bd_addr, connect_int);
|
return btc_queue_connect(UUID_SERVCLASS_HF_HANDSFREE, bd_addr, connect_int);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@@ -380,7 +380,6 @@ typedef struct {
|
|||||||
UINT16 hci_handle; /* HCI Handle */
|
UINT16 hci_handle; /* HCI Handle */
|
||||||
BOOLEAN is_orig; /* TRUE if the originator */
|
BOOLEAN is_orig; /* TRUE if the originator */
|
||||||
BOOLEAN rem_bd_known; /* TRUE if remote BD addr known */
|
BOOLEAN rem_bd_known; /* TRUE if remote BD addr known */
|
||||||
|
|
||||||
} tSCO_CONN;
|
} tSCO_CONN;
|
||||||
|
|
||||||
/* SCO Management control block */
|
/* SCO Management control block */
|
||||||
|
@@ -47,21 +47,18 @@
|
|||||||
|
|
||||||
/* command type codes */
|
/* command type codes */
|
||||||
#define AVRC_CMD_CTRL 0 /* Instruct a target to perform an operation */
|
#define AVRC_CMD_CTRL 0 /* Instruct a target to perform an operation */
|
||||||
#define AVRC_CMD_STATUS 1 /* Check a devices current status */
|
#define AVRC_CMD_STATUS 1 /* Check a device's current status */
|
||||||
#define AVRC_CMD_SPEC_INQ 2 /* Check whether a target supports a particular
|
#define AVRC_CMD_SPEC_INQ 2 /* Check whether a target supports a particular control command; all operands are included */
|
||||||
control command; all operands are included */
|
#define AVRC_CMD_NOTIF 3 /* Used for receiving notification of a change in a device's state */
|
||||||
#define AVRC_CMD_NOTIF 3 /* Used for receiving notification of a change in a devices state */
|
#define AVRC_CMD_GEN_INQ 4 /* Check whether a target supports a particular control command; operands are not included */
|
||||||
#define AVRC_CMD_GEN_INQ 4 /* Check whether a target supports a particular
|
|
||||||
control command; operands are not included */
|
|
||||||
|
|
||||||
/* response type codes */
|
/* response type codes */
|
||||||
#define AVRC_RSP_NOT_IMPL 8 /* The target does not implement the command specified
|
#define AVRC_RSP_NOT_IMPL 8 /* The target does not implement the command specified by the opcode and operand,
|
||||||
by the opcode and operand,
|
or doesn't implement the specified subunit */
|
||||||
or doesnt implement the specified subunit */
|
|
||||||
#define AVRC_RSP_ACCEPT 9 /* The target executed or is executing the command */
|
#define AVRC_RSP_ACCEPT 9 /* The target executed or is executing the command */
|
||||||
#define AVRC_RSP_REJ 10 /* The target implements the command specified by the
|
#define AVRC_RSP_REJ 10 /* The target implements the command specified by the
|
||||||
opcode but cannot respond because the current state
|
opcode but cannot respond because the current state
|
||||||
of the target doesnt allow it */
|
of the target doesn't allow it */
|
||||||
#define AVRC_RSP_IN_TRANS 11 /* The target implements the status command but it is
|
#define AVRC_RSP_IN_TRANS 11 /* The target implements the status command but it is
|
||||||
in a state of transition; the status command may
|
in a state of transition; the status command may
|
||||||
be retried at a future time */
|
be retried at a future time */
|
||||||
@@ -70,7 +67,7 @@
|
|||||||
commands, the target returns stable and includes
|
commands, the target returns stable and includes
|
||||||
the status results */
|
the status results */
|
||||||
#define AVRC_RSP_CHANGED 13 /* The response frame contains a notification that the
|
#define AVRC_RSP_CHANGED 13 /* The response frame contains a notification that the
|
||||||
target devices state has changed */
|
target device's state has changed */
|
||||||
#define AVRC_RSP_INTERIM 15 /* For control commands, the target has accepted the
|
#define AVRC_RSP_INTERIM 15 /* For control commands, the target has accepted the
|
||||||
request but cannot return information within 100
|
request but cannot return information within 100
|
||||||
milliseconds; for notify commands, the target accepted
|
milliseconds; for notify commands, the target accepted
|
||||||
|
@@ -172,7 +172,7 @@ const char *c_inband_ring_state_str[] = {
|
|||||||
// If you want to connect a specific device, add it's address here
|
// If you want to connect a specific device, add it's address here
|
||||||
esp_bd_addr_t peer_addr = {0xb4, 0xe6, 0x2d, 0xeb, 0x09, 0x93};
|
esp_bd_addr_t peer_addr = {0xb4, 0xe6, 0x2d, 0xeb, 0x09, 0x93};
|
||||||
|
|
||||||
#if CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI
|
#if CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI
|
||||||
|
|
||||||
#define ESP_HFP_RINGBUF_SIZE 3600
|
#define ESP_HFP_RINGBUF_SIZE 3600
|
||||||
static RingbufHandle_t m_rb = NULL;
|
static RingbufHandle_t m_rb = NULL;
|
||||||
@@ -185,7 +185,7 @@ static void bt_app_hf_client_audio_open(void)
|
|||||||
static void bt_app_hf_client_audio_close(void)
|
static void bt_app_hf_client_audio_close(void)
|
||||||
{
|
{
|
||||||
if (!m_rb) {
|
if (!m_rb) {
|
||||||
return 0;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
vRingbufferDelete(m_rb);
|
vRingbufferDelete(m_rb);
|
||||||
@@ -224,7 +224,7 @@ static void bt_app_hf_client_incoming_cb(const uint8_t *buf, uint32_t sz)
|
|||||||
|
|
||||||
esp_hf_client_outgoing_data_ready();
|
esp_hf_client_outgoing_data_ready();
|
||||||
}
|
}
|
||||||
#endif /* #if CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI */
|
#endif /* #if CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI */
|
||||||
|
|
||||||
/* callback for HF_CLIENT */
|
/* callback for HF_CLIENT */
|
||||||
void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_t *param)
|
void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_t *param)
|
||||||
@@ -250,7 +250,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
|
|||||||
{
|
{
|
||||||
ESP_LOGI(BT_HF_TAG, "--audio state %s",
|
ESP_LOGI(BT_HF_TAG, "--audio state %s",
|
||||||
c_audio_state_str[param->audio_stat.state]);
|
c_audio_state_str[param->audio_stat.state]);
|
||||||
#if CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI
|
#if CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI
|
||||||
if (param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_CONNECTED ||
|
if (param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_CONNECTED ||
|
||||||
param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC) {
|
param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC) {
|
||||||
esp_hf_client_register_data_callback(bt_app_hf_client_incoming_cb,
|
esp_hf_client_register_data_callback(bt_app_hf_client_incoming_cb,
|
||||||
@@ -259,7 +259,7 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
|
|||||||
} else if (param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_DISCONNECTED) {
|
} else if (param->audio_stat.state == ESP_HF_CLIENT_AUDIO_STATE_DISCONNECTED) {
|
||||||
bt_app_hf_client_audio_close();
|
bt_app_hf_client_audio_close();
|
||||||
}
|
}
|
||||||
#endif /* #if CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_HCI */
|
#endif /* #if CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user