fix(ble/bluedroid): fix L2CAP, SMP and HCI command issues

- Fix active_count check in l2cu_ble_plcb_active_count
- Restore previous state if connection command fails
- Fix HCI cmd buffer size off-by-one errors
- Fix connect handle length errors
- Fix channel sounding event status handling
- Fix SMP param_len check in smp_rand_back
- Fix spelling: BROCASTER to BROADCASTER in definitions
This commit is contained in:
zhiweijian
2026-02-27 17:59:59 +08:00
parent e0ccc644a8
commit e118d053b3
13 changed files with 183 additions and 65 deletions
@@ -260,6 +260,7 @@ typedef struct {
#define STREAM_SKIP_UINT8(p) do { (p) += 1; } while (0)
#define STREAM_SKIP_UINT16(p) do { (p) += 2; } while (0)
#define STREAM_SKIP_UINT24(p) do { (p) += 3; } while (0)
/********************************************************************************
** Macros to get and put bytes to and from a field (Little Endian format).
@@ -914,10 +914,10 @@
#if (BLE_FEAT_ISO_EN == TRUE)
#define HCI_BLE_CIS_ESTABLISHED_V1_EVT 0x19
#define HCI_BLE_CIS_REQUEST_EVT 0x1A
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
#define HCI_BLE_BIG_CREATE_COMPLETE_EVT 0x1B
#define HCI_BLE_BIG_TERMINATE_COMPLETE_EVT 0x1C
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#endif // #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
#define HCI_BLE_BIG_SYNC_ESTABLISHED_EVT 0x1D
#define HCI_BLE_BIG_SYNC_LOST_EVT 0x1E
@@ -1042,6 +1042,7 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn_v2(tHCI_CreatExtConn *p_conn);
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 filter_policy, UINT8 adv_sid,
UINT8 adv_addr_type, BD_ADDR adv_addr,
UINT16 skip,
UINT16 sync_timeout, UINT8 sync_cte_type);
UINT8 btsnd_hcic_ble_periodic_adv_create_sync_cancel(void);
@@ -1100,11 +1101,11 @@ UINT8 btsnd_hcic_ble_set_default_periodic_adv_sync_trans_params(UINT8 mode, UINT
#define HCIC_PARAM_SIZE_ISO_ACCEPT_CIS_REQ_PARAMS 2
#define HCIC_PARAM_SIZE_ISO_REJECT_CIS_REQ_PARAMS 3
#define HCIC_PARAM_SIZE_ISO_READ_LINK_QUALITY_PARAMS 2
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
#define HCIC_PARAM_SIZE_BIG_CREATE_PARAMS 31
#define HCIC_PARAM_SIZE_BIG_CREATE_TEST_PARAMS 36
#define HCIC_PARAM_SIZE_BIG_TERMINATE_PARAMS 2
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#endif // #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
#define HCIC_PARAM_SIZE_BIG_SYNC_CREATE_PARAMS 55
#define HCIC_PARAM_SIZE_BIG_SYNC_TERMINATE_PARAMS 1
@@ -1155,7 +1156,7 @@ UINT8 btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle);
UINT8 btsnd_hcic_ble_iso_reject_cis_req(uint16_t cis_handle, uint8_t reason);
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency,
uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing,
@@ -1168,7 +1169,7 @@ UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uin
uint8_t pto, uint8_t encryption, uint8_t *broadcast_code);
UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason);
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
#endif // #if (BLE_FEAT_ISO_BIG_BROADCASTER_EN == TRUE)
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
UINT8 btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle,