Loading system/device/include/esco_parameters.h +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ /******************* * SCO Codec Types *******************/ typedef enum { SCO_CODEC_NONE = 0x0000, SCO_CODEC_CVSD = 0x0001, SCO_CODEC_MSBC = 0x0002, } sco_codec_t; typedef enum { SCO_CODEC_CVSD_D1 = 0, Loading system/device/src/esco_parameters.cc +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include "check.h" constexpr enh_esco_params_t default_esco_parameters[ESCO_NUM_CODECS] = { static const enh_esco_params_t default_esco_parameters[ESCO_NUM_CODECS] = { // CVSD D1 { .transmit_bandwidth = TXRX_64KBITS_RATE, Loading system/stack/btm/btm_sco.cc +41 −0 Original line number Diff line number Diff line Loading @@ -1196,6 +1196,47 @@ void BTM_EScoConnRsp(uint16_t sco_inx, uint8_t hci_status, } } /******************************************************************************* * * Function btm_esco_proc_conn_chg * * Description This function is called by BTIF when an SCO connection * is changed. * * Returns void * ******************************************************************************/ void btm_esco_proc_conn_chg(uint8_t status, uint16_t handle, uint8_t tx_interval, uint8_t retrans_window, uint16_t rx_pkt_len, uint16_t tx_pkt_len) { tSCO_CONN* p = &btm_cb.sco_cb.sco_db[0]; tBTM_CHG_ESCO_EVT_DATA data; uint16_t xx; BTM_TRACE_EVENT("btm_esco_proc_conn_chg -> handle 0x%04x, status 0x%02x", handle, status); for (xx = 0; xx < BTM_MAX_SCO_LINKS; xx++, p++) { if (p->state == SCO_ST_CONNECTED && handle == p->hci_handle) { /* If upper layer wants notification */ if (p->esco.p_esco_cback) { data.bd_addr = p->esco.data.bd_addr; data.hci_status = status; data.sco_inx = xx; data.rx_pkt_len = p->esco.data.rx_pkt_len = rx_pkt_len; data.tx_pkt_len = p->esco.data.tx_pkt_len = tx_pkt_len; data.tx_interval = p->esco.data.tx_interval = tx_interval; data.retrans_window = p->esco.data.retrans_window = retrans_window; tBTM_ESCO_EVT_DATA btm_esco_evt_data; btm_esco_evt_data.chg_evt = data; (*p->esco.p_esco_cback)(BTM_ESCO_CHG_EVT, &btm_esco_evt_data); } return; } } } /******************************************************************************* * * Function btm_is_sco_active Loading system/stack/btu/btu_hcif.cc +11 −5 Original line number Diff line number Diff line Loading @@ -1190,11 +1190,11 @@ static void btu_hcif_esco_connection_comp_evt(uint8_t* p) { STREAM_TO_BDADDR(bda, p); STREAM_TO_UINT8(data.link_type, p); STREAM_SKIP_UINT8(p); // tx_interval STREAM_SKIP_UINT8(p); // retrans_window STREAM_SKIP_UINT16(p); // rx_pkt_len STREAM_SKIP_UINT16(p); // tx_pkt_len STREAM_SKIP_UINT8(p); // air_mode STREAM_TO_UINT8(data.tx_interval, p); STREAM_TO_UINT8(data.retrans_window, p); STREAM_TO_UINT16(data.rx_pkt_len, p); STREAM_TO_UINT16(data.tx_pkt_len, p); STREAM_TO_UINT8(data.air_mode, p); handle = HCID_GET_HANDLE(handle); Loading Loading @@ -1228,6 +1228,9 @@ static void btu_hcif_esco_connection_chg_evt(uint8_t* p) { STREAM_TO_UINT16(tx_pkt_len, p); handle = HCID_GET_HANDLE(handle); btm_esco_proc_conn_chg(status, handle, tx_interval, retrans_window, rx_pkt_len, tx_pkt_len); } /******************************************************************************* Loading Loading @@ -1453,6 +1456,9 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status, if (status != HCI_SUCCESS) { STREAM_TO_UINT16(handle, p_cmd); // Determine if initial connection failed or is a change of setup if (btm_is_sco_active(handle)) { btm_esco_proc_conn_chg(status, handle, 0, 0, 0, 0); } } break; Loading system/stack/include/btm_api_types.h +17 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,7 @@ typedef void(tBTM_SCO_CB)(uint16_t sco_inx); * eSCO Types ***************/ /* tBTM_ESCO_CBACK event types */ #define BTM_ESCO_CHG_EVT 1 #define BTM_ESCO_CONN_REQ_EVT 2 typedef uint8_t tBTM_ESCO_EVT; Loading @@ -401,10 +402,25 @@ typedef struct { /* Returned by BTM_ReadEScoLinkParms() */ struct tBTM_ESCO_DATA { uint16_t rx_pkt_len; uint16_t tx_pkt_len; RawAddress bd_addr; uint8_t link_type; /* BTM_LINK_TYPE_SCO or BTM_LINK_TYPE_ESCO */ uint8_t tx_interval; uint8_t retrans_window; uint8_t air_mode; }; typedef struct { uint16_t sco_inx; uint16_t rx_pkt_len; uint16_t tx_pkt_len; RawAddress bd_addr; uint8_t hci_status; uint8_t tx_interval; uint8_t retrans_window; } tBTM_CHG_ESCO_EVT_DATA; typedef struct { uint16_t sco_inx; RawAddress bd_addr; Loading @@ -413,6 +429,7 @@ typedef struct { } tBTM_ESCO_CONN_REQ_EVT_DATA; typedef union { tBTM_CHG_ESCO_EVT_DATA chg_evt; tBTM_ESCO_CONN_REQ_EVT_DATA conn_evt; } tBTM_ESCO_EVT_DATA; Loading Loading
system/device/include/esco_parameters.h +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ /******************* * SCO Codec Types *******************/ typedef enum { SCO_CODEC_NONE = 0x0000, SCO_CODEC_CVSD = 0x0001, SCO_CODEC_MSBC = 0x0002, } sco_codec_t; typedef enum { SCO_CODEC_CVSD_D1 = 0, Loading
system/device/src/esco_parameters.cc +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include "check.h" constexpr enh_esco_params_t default_esco_parameters[ESCO_NUM_CODECS] = { static const enh_esco_params_t default_esco_parameters[ESCO_NUM_CODECS] = { // CVSD D1 { .transmit_bandwidth = TXRX_64KBITS_RATE, Loading
system/stack/btm/btm_sco.cc +41 −0 Original line number Diff line number Diff line Loading @@ -1196,6 +1196,47 @@ void BTM_EScoConnRsp(uint16_t sco_inx, uint8_t hci_status, } } /******************************************************************************* * * Function btm_esco_proc_conn_chg * * Description This function is called by BTIF when an SCO connection * is changed. * * Returns void * ******************************************************************************/ void btm_esco_proc_conn_chg(uint8_t status, uint16_t handle, uint8_t tx_interval, uint8_t retrans_window, uint16_t rx_pkt_len, uint16_t tx_pkt_len) { tSCO_CONN* p = &btm_cb.sco_cb.sco_db[0]; tBTM_CHG_ESCO_EVT_DATA data; uint16_t xx; BTM_TRACE_EVENT("btm_esco_proc_conn_chg -> handle 0x%04x, status 0x%02x", handle, status); for (xx = 0; xx < BTM_MAX_SCO_LINKS; xx++, p++) { if (p->state == SCO_ST_CONNECTED && handle == p->hci_handle) { /* If upper layer wants notification */ if (p->esco.p_esco_cback) { data.bd_addr = p->esco.data.bd_addr; data.hci_status = status; data.sco_inx = xx; data.rx_pkt_len = p->esco.data.rx_pkt_len = rx_pkt_len; data.tx_pkt_len = p->esco.data.tx_pkt_len = tx_pkt_len; data.tx_interval = p->esco.data.tx_interval = tx_interval; data.retrans_window = p->esco.data.retrans_window = retrans_window; tBTM_ESCO_EVT_DATA btm_esco_evt_data; btm_esco_evt_data.chg_evt = data; (*p->esco.p_esco_cback)(BTM_ESCO_CHG_EVT, &btm_esco_evt_data); } return; } } } /******************************************************************************* * * Function btm_is_sco_active Loading
system/stack/btu/btu_hcif.cc +11 −5 Original line number Diff line number Diff line Loading @@ -1190,11 +1190,11 @@ static void btu_hcif_esco_connection_comp_evt(uint8_t* p) { STREAM_TO_BDADDR(bda, p); STREAM_TO_UINT8(data.link_type, p); STREAM_SKIP_UINT8(p); // tx_interval STREAM_SKIP_UINT8(p); // retrans_window STREAM_SKIP_UINT16(p); // rx_pkt_len STREAM_SKIP_UINT16(p); // tx_pkt_len STREAM_SKIP_UINT8(p); // air_mode STREAM_TO_UINT8(data.tx_interval, p); STREAM_TO_UINT8(data.retrans_window, p); STREAM_TO_UINT16(data.rx_pkt_len, p); STREAM_TO_UINT16(data.tx_pkt_len, p); STREAM_TO_UINT8(data.air_mode, p); handle = HCID_GET_HANDLE(handle); Loading Loading @@ -1228,6 +1228,9 @@ static void btu_hcif_esco_connection_chg_evt(uint8_t* p) { STREAM_TO_UINT16(tx_pkt_len, p); handle = HCID_GET_HANDLE(handle); btm_esco_proc_conn_chg(status, handle, tx_interval, retrans_window, rx_pkt_len, tx_pkt_len); } /******************************************************************************* Loading Loading @@ -1453,6 +1456,9 @@ static void btu_hcif_hdl_command_status(uint16_t opcode, uint8_t status, if (status != HCI_SUCCESS) { STREAM_TO_UINT16(handle, p_cmd); // Determine if initial connection failed or is a change of setup if (btm_is_sco_active(handle)) { btm_esco_proc_conn_chg(status, handle, 0, 0, 0, 0); } } break; Loading
system/stack/include/btm_api_types.h +17 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,7 @@ typedef void(tBTM_SCO_CB)(uint16_t sco_inx); * eSCO Types ***************/ /* tBTM_ESCO_CBACK event types */ #define BTM_ESCO_CHG_EVT 1 #define BTM_ESCO_CONN_REQ_EVT 2 typedef uint8_t tBTM_ESCO_EVT; Loading @@ -401,10 +402,25 @@ typedef struct { /* Returned by BTM_ReadEScoLinkParms() */ struct tBTM_ESCO_DATA { uint16_t rx_pkt_len; uint16_t tx_pkt_len; RawAddress bd_addr; uint8_t link_type; /* BTM_LINK_TYPE_SCO or BTM_LINK_TYPE_ESCO */ uint8_t tx_interval; uint8_t retrans_window; uint8_t air_mode; }; typedef struct { uint16_t sco_inx; uint16_t rx_pkt_len; uint16_t tx_pkt_len; RawAddress bd_addr; uint8_t hci_status; uint8_t tx_interval; uint8_t retrans_window; } tBTM_CHG_ESCO_EVT_DATA; typedef struct { uint16_t sco_inx; RawAddress bd_addr; Loading @@ -413,6 +429,7 @@ typedef struct { } tBTM_ESCO_CONN_REQ_EVT_DATA; typedef union { tBTM_CHG_ESCO_EVT_DATA chg_evt; tBTM_ESCO_CONN_REQ_EVT_DATA conn_evt; } tBTM_ESCO_EVT_DATA; Loading