OSDN Git Service

Add API tSCO_CONN::is_active,Handle
authorChris Manton <cmanton@google.com>
Sat, 16 Jan 2021 00:57:55 +0000 (16:57 -0800)
committerChris Manton <cmanton@google.com>
Wed, 20 Jan 2021 07:12:58 +0000 (23:12 -0800)
Towards encapsulated code

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

Change-Id: I4f99dd54ad056fbb4ef636779cc0d661890c622c

stack/btm/btm_sco.h

index 7441940..63687d9 100644 (file)
@@ -79,7 +79,12 @@ typedef struct {
   tBTM_SCO_CB* p_conn_cb; /* Callback for when connected  */
   tBTM_SCO_CB* p_disc_cb; /* Callback for when disconnect */
   tSCO_STATE state;       /* The state of the SCO link    */
+
   uint16_t hci_handle;    /* HCI Handle                   */
+ public:
+  bool is_active() const { return state != SCO_ST_UNUSED; }
+  uint16_t Handle() const { return hci_handle; }
+
   bool is_orig;           /* true if the originator       */
   bool rem_bd_known;      /* true if remote BD addr known */