universal7580: bluetooth: Add ISO
authorJakub Pawlowski <jpawlowski@google.com>
Tue, 5 Nov 2019 11:27:29 +0000 (12:27 +0100)
committerJan Altensen <info@stricted.net>
Mon, 21 Sep 2020 19:05:48 +0000 (21:05 +0200)
Test: run rootcanal, verify 1.1 HAL can be used
Bug: 144413056
Change-Id: Ic5b33602e1e4ba8e6d16623b9f8c46f674fc476c

hardware/bluetooth/bluetooth_hci.cc
hardware/bluetooth/vendor_interface.cc
hardware/bluetooth/vendor_interface.h

index e14e3d70428d2009fb15f9cbce5e5f2b6a2d006a..a2211f4e836ae5ea68df616d04fc451a3750b76d 100644 (file)
@@ -89,6 +89,9 @@ Return<void> BluetoothHci::initialize(
         if (!hidl_status.isOk()) {
           ALOGE("VendorInterface -> Unable to call scoDataReceived()");
         }
+      },
+      [cb](const hidl_vec<uint8_t>&) {
+        ALOGE("VendorInterface -> No callback for ISO packets in HAL V1_0");
       });
   if (!rc) {
     auto hidl_status = cb->initializationComplete(Status::INITIALIZATION_ERROR);
index af89f812600a07fb46c8cd004d1dd4d49fbdfba3..6e97e77567776cf063c8316c8006b14df94c0c08 100644 (file)
@@ -162,14 +162,14 @@ class FirmwareStartupTimer {
 bool VendorInterface::Initialize(
     InitializeCompleteCallback initialize_complete_cb,
     PacketReadCallback event_cb, PacketReadCallback acl_cb,
-    PacketReadCallback sco_cb) {
+    PacketReadCallback sco_cb, PacketReadCallback iso_cb) {
   if (g_vendor_interface) {
     ALOGE("%s: No previous Shutdown()?", __func__);
     return false;
   }
   g_vendor_interface = new VendorInterface();
   return g_vendor_interface->Open(initialize_complete_cb, event_cb, acl_cb,
-                                  sco_cb);
+                                  sco_cb, iso_cb);
 }
 
 void VendorInterface::Shutdown() {
@@ -185,7 +185,8 @@ VendorInterface* VendorInterface::get() { return g_vendor_interface; }
 bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
                            PacketReadCallback event_cb,
                            PacketReadCallback acl_cb,
-                           PacketReadCallback sco_cb) {
+                           PacketReadCallback sco_cb,
+                           PacketReadCallback iso_cb) {
   initialize_complete_cb_ = initialize_complete_cb;
 
   // Initialize vendor interface
@@ -248,7 +249,7 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
 
   if (fd_count == 1) {
     hci::H4Protocol* h4_hci =
-        new hci::H4Protocol(fd_list[0], intercept_events, acl_cb, sco_cb);
+        new hci::H4Protocol(fd_list[0], intercept_events, acl_cb, sco_cb, iso_cb);
     fd_watcher_.WatchFdForNonBlockingReads(
         fd_list[0], [h4_hci](int fd) { h4_hci->OnDataReady(fd); });
     hci_ = h4_hci;
index a401ee6e55ab12eee0969eeadc70e160733ec4d5..e5b8d0155119a940eccf83baf483d0895bfab4fd 100644 (file)
@@ -38,7 +38,7 @@ class VendorInterface {
  public:
   static bool Initialize(InitializeCompleteCallback initialize_complete_cb,
                          PacketReadCallback event_cb, PacketReadCallback acl_cb,
-                         PacketReadCallback sco_cb);
+                         PacketReadCallback sco_cb, PacketReadCallback iso_cb);
   static void Shutdown();
   static VendorInterface *get();
 
@@ -51,7 +51,7 @@ class VendorInterface {
 
   bool Open(InitializeCompleteCallback initialize_complete_cb,
             PacketReadCallback event_cb, PacketReadCallback acl_cb,
-            PacketReadCallback sco_cb);
+            PacketReadCallback sco_cb, PacketReadCallback iso_cb);
   void Close();
 
   void OnTimeout();