OSDN Git Service

Add API tACL_CONN::is_{disconnect/role_switch}_pending
authorChris Manton <cmanton@google.com>
Sun, 17 Jan 2021 17:00:18 +0000 (09:00 -0800)
committerChris Manton <cmanton@google.com>
Wed, 20 Jan 2021 16:05:28 +0000 (08:05 -0800)
Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I0420630f45bb16719e669c9f75f929ba46c88c2e

stack/acl/acl.h

index 10c18c5..88a0b2b 100644 (file)
@@ -253,6 +253,14 @@ struct sACL_CONN {
 #define BTM_SEC_DISC_PENDING 2   /* Disconnect is pending */
   uint8_t rs_disc_pending = BTM_SEC_RS_NOT_PENDING;
 
+ public:
+  bool is_disconnect_pending() const {
+    return rs_disc_pending == BTM_SEC_DISC_PENDING;
+  }
+  bool is_role_switch_pending() const {
+    return rs_disc_pending == BTM_SEC_RS_PENDING;
+  }
+
  private:
   uint8_t switch_role_state_;