mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'idf/ble_iso_minor_update_v6.1' into 'release/v6.1'
feat(ble_iso): Minor update for some ISO internal functions (v6.1) See merge request espressif/esp-idf!49324
This commit is contained in:
@@ -481,23 +481,6 @@ int bt_le_bluedroid_scan_stop(void)
|
|||||||
return bluedroid_err_to_errno(status);
|
return bluedroid_err_to_errno(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_le_bluedroid_iso_disconnect(uint16_t conn_handle, uint8_t reason)
|
|
||||||
{
|
|
||||||
tBTM_STATUS status;
|
|
||||||
|
|
||||||
LOG_DBG("[B]IsoDisconn[0x%03x][%02x]", conn_handle, reason);
|
|
||||||
|
|
||||||
/* No direct_hci variant: HCI Disconnect returns Command_Status;
|
|
||||||
* outcome arrives via BTM_BLE_ISO_CIS_DISCONNECTED_EVT. */
|
|
||||||
status = BTM_BleDisconCis(conn_handle, reason);
|
|
||||||
|
|
||||||
if (status != BTM_SUCCESS) {
|
|
||||||
LOG_ERR("[B]IsoDisconnFail[0x%03x][%02x]", conn_handle, status);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bluedroid_err_to_errno(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_le_bluedroid_gap_init(void)
|
int bt_le_bluedroid_gap_init(void)
|
||||||
{
|
{
|
||||||
BTM_BleGapRegisterCallback(gap_app_cb);
|
BTM_BleGapRegisterCallback(gap_app_cb);
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ int bt_le_bluedroid_scan_start(const struct bt_le_scan_param *param);
|
|||||||
|
|
||||||
int bt_le_bluedroid_scan_stop(void);
|
int bt_le_bluedroid_scan_stop(void);
|
||||||
|
|
||||||
int bt_le_bluedroid_iso_disconnect(uint16_t conn_handle, uint8_t reason);
|
|
||||||
|
|
||||||
int bt_le_bluedroid_gap_init(void);
|
int bt_le_bluedroid_gap_init(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ extern "C" {
|
|||||||
|
|
||||||
struct net_buf;
|
struct net_buf;
|
||||||
|
|
||||||
int bt_le_bluedroid_hci_iso_cmd_send_sync(uint16_t opcode,
|
int bt_le_bluedroid_iso_cmd_send_sync(uint16_t opcode,
|
||||||
struct net_buf *buf,
|
struct net_buf *buf,
|
||||||
struct net_buf **rsp);
|
struct net_buf **rsp);
|
||||||
|
|
||||||
|
int bt_le_bluedroid_iso_disconnect(uint16_t conn_handle, uint8_t reason);
|
||||||
|
|
||||||
int bt_le_bluedroid_iso_init(void);
|
int bt_le_bluedroid_iso_init(void);
|
||||||
|
|
||||||
|
|||||||
@@ -749,9 +749,9 @@ static int hci_cmd_remove_iso_data_path(struct net_buf *buf, struct net_buf **rs
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_le_bluedroid_hci_iso_cmd_send_sync(uint16_t opcode,
|
int bt_le_bluedroid_iso_cmd_send_sync(uint16_t opcode,
|
||||||
struct net_buf *buf,
|
struct net_buf *buf,
|
||||||
struct net_buf **rsp)
|
struct net_buf **rsp)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -1197,8 +1197,44 @@ static int iso_enable_cis(void)
|
|||||||
|
|
||||||
return bluedroid_err_to_errno(status);
|
return bluedroid_err_to_errno(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int iso_disable_cis(void)
|
||||||
|
{
|
||||||
|
tBTM_STATUS status;
|
||||||
|
|
||||||
|
#if USE_DIRECT_HCI
|
||||||
|
/* HCI LE Set Host Feature: Bit_Number(1) | Bit_Value(1).
|
||||||
|
* bit 32 = LE ISO Channels (Host Support). */
|
||||||
|
uint8_t cmd_params[2] = { 32, 0 };
|
||||||
|
|
||||||
|
status = bt_le_bluedroid_hci_send_sync(HCI_BLE_SET_HOST_FEATURE,
|
||||||
|
cmd_params, sizeof(cmd_params),
|
||||||
|
NULL, 0);
|
||||||
|
#else /* USE_DIRECT_HCI */
|
||||||
|
status = BTM_BleSetHostFeature(32, 0);
|
||||||
|
#endif /* USE_DIRECT_HCI */
|
||||||
|
|
||||||
|
return bluedroid_err_to_errno(status);
|
||||||
|
}
|
||||||
#endif /* CONFIG_BT_ISO_UNICAST */
|
#endif /* CONFIG_BT_ISO_UNICAST */
|
||||||
|
|
||||||
|
int bt_le_bluedroid_iso_disconnect(uint16_t conn_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
tBTM_STATUS status;
|
||||||
|
|
||||||
|
LOG_DBG("[B]IsoDisconn[0x%03x][%02x]", conn_handle, reason);
|
||||||
|
|
||||||
|
/* No direct_hci variant: HCI Disconnect returns Command_Status;
|
||||||
|
* outcome arrives via BTM_BLE_ISO_CIS_DISCONNECTED_EVT. */
|
||||||
|
status = BTM_BleDisconCis(conn_handle, reason);
|
||||||
|
|
||||||
|
if (status != BTM_SUCCESS) {
|
||||||
|
LOG_ERR("[B]IsoDisconnFail[0x%03x][%02x]", conn_handle, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return bluedroid_err_to_errno(status);
|
||||||
|
}
|
||||||
|
|
||||||
int bt_le_bluedroid_iso_init(void)
|
int bt_le_bluedroid_iso_init(void)
|
||||||
{
|
{
|
||||||
#if CONFIG_BT_ISO_UNICAST
|
#if CONFIG_BT_ISO_UNICAST
|
||||||
@@ -1245,17 +1281,7 @@ void bt_le_bluedroid_iso_deinit(void)
|
|||||||
{
|
{
|
||||||
#if CONFIG_BT_ISO_UNICAST
|
#if CONFIG_BT_ISO_UNICAST
|
||||||
/* Mirror bt_le_iso_init() which enables bit 32 only on unicast build. */
|
/* Mirror bt_le_iso_init() which enables bit 32 only on unicast build. */
|
||||||
#if USE_DIRECT_HCI
|
iso_disable_cis();
|
||||||
{
|
|
||||||
uint8_t cmd_params[2] = { 32, 0 };
|
|
||||||
|
|
||||||
bt_le_bluedroid_hci_send_sync(HCI_BLE_SET_HOST_FEATURE,
|
|
||||||
cmd_params, sizeof(cmd_params),
|
|
||||||
NULL, 0);
|
|
||||||
}
|
|
||||||
#else /* USE_DIRECT_HCI */
|
|
||||||
BTM_BleSetHostFeature(32, 0);
|
|
||||||
#endif /* USE_DIRECT_HCI */
|
|
||||||
#endif /* CONFIG_BT_ISO_UNICAST */
|
#endif /* CONFIG_BT_ISO_UNICAST */
|
||||||
|
|
||||||
#if CONFIG_BT_ISO_RX
|
#if CONFIG_BT_ISO_RX
|
||||||
|
|||||||
@@ -287,8 +287,3 @@ int bt_le_nimble_scan_stop(void)
|
|||||||
|
|
||||||
return nimble_err_to_errno(rc);
|
return nimble_err_to_errno(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_le_nimble_iso_disconnect(uint16_t conn_handle, uint8_t reason)
|
|
||||||
{
|
|
||||||
return nimble_err_to_errno(ble_gap_iso_disconnect(conn_handle, reason));
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ int bt_le_nimble_scan_start(const struct bt_le_scan_param *param, ble_gap_event_
|
|||||||
|
|
||||||
int bt_le_nimble_scan_stop(void);
|
int bt_le_nimble_scan_stop(void);
|
||||||
|
|
||||||
int bt_le_nimble_iso_disconnect(uint16_t conn_handle, uint8_t reason);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ int bt_le_nimble_iso_cmd_send_sync(uint16_t opcode,
|
|||||||
struct net_buf *buf,
|
struct net_buf *buf,
|
||||||
struct net_buf **rsp);
|
struct net_buf **rsp);
|
||||||
|
|
||||||
|
int bt_le_nimble_iso_disconnect(uint16_t conn_handle, uint8_t reason);
|
||||||
|
|
||||||
int bt_le_nimble_iso_init(void);
|
int bt_le_nimble_iso_init(void);
|
||||||
|
|
||||||
void bt_le_nimble_iso_deinit(void);
|
void bt_le_nimble_iso_deinit(void);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <../host/iso_internal.h>
|
#include <../host/iso_internal.h>
|
||||||
|
|
||||||
#include "../src/ble_hs_priv.h"
|
#include "../src/ble_hs_priv.h"
|
||||||
|
#include "host/ble_gap.h"
|
||||||
#include "host/ble_hs_iso.h"
|
#include "host/ble_hs_iso.h"
|
||||||
#include "host/ble_hs_iso_hci.h"
|
#include "host/ble_hs_iso_hci.h"
|
||||||
|
|
||||||
@@ -838,6 +839,11 @@ static int iso_disable_cis(void)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_ISO_UNICAST */
|
#endif /* CONFIG_BT_ISO_UNICAST */
|
||||||
|
|
||||||
|
int bt_le_nimble_iso_disconnect(uint16_t conn_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
return nimble_err_to_errno(ble_gap_iso_disconnect(conn_handle, reason));
|
||||||
|
}
|
||||||
|
|
||||||
int bt_le_nimble_iso_init(void)
|
int bt_le_nimble_iso_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode,
|
|||||||
LOG_DBG("HciCmdSendSync[%04x]", opcode);
|
LOG_DBG("HciCmdSendSync[%04x]", opcode);
|
||||||
|
|
||||||
#if CONFIG_BT_BLUEDROID_ENABLED
|
#if CONFIG_BT_BLUEDROID_ENABLED
|
||||||
return bt_le_bluedroid_hci_iso_cmd_send_sync(opcode, buf, rsp);
|
return bt_le_bluedroid_iso_cmd_send_sync(opcode, buf, rsp);
|
||||||
#else
|
#else
|
||||||
return bt_le_nimble_iso_cmd_send_sync(opcode, buf, rsp);
|
return bt_le_nimble_iso_cmd_send_sync(opcode, buf, rsp);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user