From 7ed1d48cc2b49af34a787e1d94708325338bf92d Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sat, 19 Sep 2020 14:08:21 -0700 Subject: [PATCH] Add Api for tACL_CB::tACL_CONN::transport Towards readable code Bug: 163134718 Tag: #refactor Test: acts -tc BleCocTest Test: ble paired 2 phones Change-Id: I3c46c8ecf15a382e0234013626312d5c8cc3ecb2 --- stack/acl/acl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stack/acl/acl.h b/stack/acl/acl.h index b5cf1b4e3..d6a5649b1 100644 --- a/stack/acl/acl.h +++ b/stack/acl/acl.h @@ -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; -- 2.11.0