OSDN Git Service

Add Api for tACL_CB::tACL_CONN::transport
authorChris Manton <cmanton@google.com>
Sat, 19 Sep 2020 21:08:21 +0000 (14:08 -0700)
committerChris Manton <cmanton@google.com>
Thu, 24 Sep 2020 17:43:57 +0000 (10:43 -0700)
Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I3c46c8ecf15a382e0234013626312d5c8cc3ecb2

stack/acl/acl.h

index b5cf1b4..d6a5649 100644 (file)
@@ -60,6 +60,12 @@ typedef struct {
   bool in_use;
   bool link_up_issued;
   tBT_TRANSPORT transport;
+  bool is_transport_br_edr() const { return transport == BT_TRANSPORT_BR_EDR; }
+  bool is_transport_ble() const { return transport == BT_TRANSPORT_LE; }
+  bool is_transport_valid() const {
+    return is_transport_ble() || is_transport_br_edr();
+  }
+
   uint16_t clock_offset;
   uint16_t flush_timeout_in_ticks;
   uint16_t hci_handle;