OSDN Git Service

hci: Add additional iso related commands
authorGrzegorz Kołodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
Tue, 11 Aug 2020 13:07:19 +0000 (15:07 +0200)
committerJakub Pawlowski <jpawlowski@google.com>
Thu, 20 Aug 2020 15:44:44 +0000 (15:44 +0000)
These are not necessary for the upcoming le audio implementation
but may become useful in near future.

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compilation
Change-Id: Ice003a604da44d5430b6b356e6f16d0fcbdf1873

stack/hcic/hciblecmds.cc
stack/include/hcimsgs.h

index 854ee84..16d3bb1 100644 (file)
@@ -820,6 +820,18 @@ void btsnd_hcic_ble_ext_create_conn(uint8_t init_filter_policy,
   btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
 }
 
+void btsnd_hcic_read_iso_tx_sync(
+    uint16_t iso_handle, base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
+  const int params_len = 2;
+  uint8_t param[params_len];
+  uint8_t* pp = param;
+
+  UINT16_TO_STREAM(pp, iso_handle);
+
+  btu_hcif_send_cmd_with_cb(FROM_HERE, HCI_LE_READ_ISO_TX_SYNC, param,
+                            params_len, std::move(cb));
+}
+
 void btsnd_hcic_set_cig_params(
     uint8_t cig_id, uint32_t sdu_itv_mtos, uint32_t sdu_itv_stom, uint8_t sca,
     uint8_t packing, uint8_t framing, uint16_t max_trans_lat_stom,
@@ -885,6 +897,35 @@ void btsnd_hcic_remove_cig(uint8_t cig_id,
                             std::move(cb));
 }
 
+void btsnd_hcic_accept_cis_req(uint16_t conn_handle) {
+  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
+  uint8_t* pp = (uint8_t*)(p + 1);
+
+  const int param_len = 2;
+  p->len = HCIC_PREAMBLE_SIZE + param_len;
+  p->offset = 0;
+
+  UINT16_TO_STREAM(pp, HCI_LE_ACCEPT_CIS_REQ);
+  UINT8_TO_STREAM(pp, param_len);
+
+  UINT16_TO_STREAM(pp, conn_handle);
+
+  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
+}
+
+void btsnd_hcic_rej_cis_req(uint16_t conn_handle, uint8_t reason,
+                            base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
+  const int params_len = 3;
+  uint8_t param[params_len];
+  uint8_t* pp = param;
+
+  UINT16_TO_STREAM(pp, conn_handle);
+  UINT8_TO_STREAM(pp, reason);
+
+  btu_hcif_send_cmd_with_cb(FROM_HERE, HCI_LE_REJ_CIS_REQ, param, params_len,
+                            std::move(cb));
+}
+
 void btsnd_hcic_req_peer_sca(uint16_t conn_handle) {
   BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
   uint8_t* pp = (uint8_t*)(p + 1);
index 65a765f..be004f1 100644 (file)
@@ -888,6 +888,9 @@ extern void btsnd_hcic_read_authenticated_payload_tout(uint16_t handle);
 extern void btsnd_hcic_write_authenticated_payload_tout(uint16_t handle,
                                                         uint16_t timeout);
 
+extern void btsnd_hcic_read_iso_tx_sync(
+    uint16_t iso_handle, base::OnceCallback<void(uint8_t*, uint16_t)> cb);
+
 struct EXT_CIS_CFG {
   uint8_t cis_id;
   uint16_t max_sdu_size_mtos;
@@ -928,6 +931,12 @@ extern void btsnd_hcic_create_cis(uint8_t num_cis,
 extern void btsnd_hcic_remove_cig(
     uint8_t cig_id, base::OnceCallback<void(uint8_t*, uint16_t)> cb);
 
+extern void btsnd_hcic_accept_cis_req(uint16_t conn_handle);
+
+extern void btsnd_hcic_rej_cis_req(
+    uint16_t conn_handle, uint8_t reason,
+    base::OnceCallback<void(uint8_t*, uint16_t)> cb);
+
 extern void btsnd_hcic_req_peer_sca(uint16_t conn_handle);
 
 extern void btsnd_hcic_setup_iso_data_path(