From 280fcc183744abdc2f3b2b3196759c99435da00d Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 3 Dec 2020 10:22:29 -0800 Subject: [PATCH] Add APIs for default acl behavior Towards readable code Bug: 163134718 Tag: #refactor Test: gd/cert/run --host Change-Id: I6b8fc419ae42480884fb821dbd5663150b7ab12f --- stack/acl/acl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stack/acl/acl.h b/stack/acl/acl.h index b7b82d158..46294a504 100644 --- a/stack/acl/acl.h +++ b/stack/acl/acl.h @@ -292,4 +292,18 @@ typedef struct { public: tHCI_STATUS get_disconnect_reason() const { return acl_disc_reason; } void set_disconnect_reason(tHCI_STATUS reason) { acl_disc_reason = reason; } + uint16_t DefaultPacketTypes() const { return btm_acl_pkt_types_supported; } + uint16_t DefaultLinkPolicy() const { return btm_def_link_policy; } + uint16_t DefaultSupervisorTimeout() const { return btm_def_link_super_tout; } + void SetDefaultSupervisorTimeout(uint16_t timeout) { + btm_def_link_super_tout = timeout; + } + + unsigned NumberOfActiveLinks() const { + unsigned cnt = 0; + for (int i = 0; i < MAX_L2CAP_LINKS; i++) { + if (acl_db[i].InUse()) ++cnt; + } + return cnt; + } } tACL_CB; -- 2.11.0