Loading system/gd/hal/hci_backend_aidl.cc +0 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ class AidlHciCallbacks : public ::aidl::android::hardware::bluetooth::BnBluetoot class AidlHci : public HciBackend { public: AidlHci(const char* service_name) { common::StopWatch stop_watch(__func__); ::ndk::SpAIBinder binder(AServiceManager_waitForService(service_name)); hci_ = aidl::android::hardware::bluetooth::IBluetoothHci::fromBinder(binder); log::assert_that(hci_ != nullptr, "Failed to retrieve AIDL interface."); Loading system/gd/hal/hci_backend_hidl.cc +0 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,6 @@ class HidlHci : public HciBackend { public: HidlHci(Handler* module_handler) { common::StopWatch stop_watch(__func__); log::info("Trying to find a HIDL interface"); auto get_service_alarm = new os::Alarm(module_handler); Loading system/gd/hal/hci_hal_android.cc +17 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ #include <future> #include <mutex> #include "common/stop_watch.h" #include "common/strings.h" #include "hal/hci_backend.h" #include "hal/hci_hal.h" #include "hal/link_clocker.h" Loading @@ -26,6 +28,15 @@ namespace bluetooth::hal { template <class VecType> std::string GetTimerText(const char* func_name, VecType vec) { return common::StringFormat( "%s: len %zu, 1st 5 bytes '%s'", func_name, vec.size(), common::ToHexString(vec.begin(), std::min(vec.end(), vec.begin() + 5)).c_str()); } class HciCallbacksImpl : public HciBackendCallbacks { class : public HciHalCallbacks { public: Loading Loading @@ -63,10 +74,12 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void initializationComplete() override { common::StopWatch stop_watch(__func__); init_promise_.set_value(); } void hciEventReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); link_clocker_->OnHciEvent(packet); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::EVT); Loading @@ -77,6 +90,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void aclDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::ACL); { Loading @@ -86,6 +100,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void scoDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::SCO); { Loading @@ -95,6 +110,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void isoDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::ISO); { Loading Loading @@ -152,6 +168,7 @@ class HciHalImpl : public HciHal { } void Start() override { common::StopWatch stop_watch(__func__); log::assert_that( backend_ == nullptr, "Start can't be called more than once before Stop is called."); Loading Loading
system/gd/hal/hci_backend_aidl.cc +0 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ class AidlHciCallbacks : public ::aidl::android::hardware::bluetooth::BnBluetoot class AidlHci : public HciBackend { public: AidlHci(const char* service_name) { common::StopWatch stop_watch(__func__); ::ndk::SpAIBinder binder(AServiceManager_waitForService(service_name)); hci_ = aidl::android::hardware::bluetooth::IBluetoothHci::fromBinder(binder); log::assert_that(hci_ != nullptr, "Failed to retrieve AIDL interface."); Loading
system/gd/hal/hci_backend_hidl.cc +0 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,6 @@ class HidlHci : public HciBackend { public: HidlHci(Handler* module_handler) { common::StopWatch stop_watch(__func__); log::info("Trying to find a HIDL interface"); auto get_service_alarm = new os::Alarm(module_handler); Loading
system/gd/hal/hci_hal_android.cc +17 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ #include <future> #include <mutex> #include "common/stop_watch.h" #include "common/strings.h" #include "hal/hci_backend.h" #include "hal/hci_hal.h" #include "hal/link_clocker.h" Loading @@ -26,6 +28,15 @@ namespace bluetooth::hal { template <class VecType> std::string GetTimerText(const char* func_name, VecType vec) { return common::StringFormat( "%s: len %zu, 1st 5 bytes '%s'", func_name, vec.size(), common::ToHexString(vec.begin(), std::min(vec.end(), vec.begin() + 5)).c_str()); } class HciCallbacksImpl : public HciBackendCallbacks { class : public HciHalCallbacks { public: Loading Loading @@ -63,10 +74,12 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void initializationComplete() override { common::StopWatch stop_watch(__func__); init_promise_.set_value(); } void hciEventReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); link_clocker_->OnHciEvent(packet); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::EVT); Loading @@ -77,6 +90,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void aclDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::ACL); { Loading @@ -86,6 +100,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void scoDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::SCO); { Loading @@ -95,6 +110,7 @@ class HciCallbacksImpl : public HciBackendCallbacks { } void isoDataReceived(const std::vector<uint8_t>& packet) override { common::StopWatch stop_watch(GetTimerText(__func__, packet)); btsnoop_logger_->Capture( packet, SnoopLogger::Direction::INCOMING, SnoopLogger::PacketType::ISO); { Loading Loading @@ -152,6 +168,7 @@ class HciHalImpl : public HciHal { } void Start() override { common::StopWatch stop_watch(__func__); log::assert_that( backend_ == nullptr, "Start can't be called more than once before Stop is called."); Loading