OSDN Git Service

Add tBTA_DM_SSR_SPEC.name[] field for sniff subrating options
authorChris Manton <cmanton@google.com>
Tue, 8 Dec 2020 21:34:52 +0000 (13:34 -0800)
committerChris Manton <cmanton@google.com>
Thu, 17 Dec 2020 16:17:21 +0000 (08:17 -0800)
Towards loggable code

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

Change-Id: I4c3005f0648a4c8b3b9fdba4fe4489caf9283a5f

bta/dm/bta_dm_cfg.cc
bta/dm/bta_dm_int.h

index 55b65c2..c558709 100644 (file)
@@ -534,14 +534,15 @@ tBTA_DM_PM_TYPE_QUALIFIER tBTM_PM_PWR_MD bta_dm_pm_md[] = {
  * lowest latency */
 tBTA_DM_SSR_SPEC bta_dm_ssr_spec[] = {
     /*max_lat, min_rmt_to, min_loc_to*/
-    {0, 0, 0}, /* BTA_DM_PM_SSR0 - do not use SSR */
+    {0, 0, 0, "no_ssr"}, /* BTA_DM_PM_SSR0 - do not use SSR */
     /* BTA_DM_PM_SSR1 - HH, can NOT share entry with any other profile, seting
        default max latency and min remote timeout as 0, and always read
        individual device preference from HH module */
-    {0, 0, 2},
-    {1200, 2, 2},     /* BTA_DM_PM_SSR2 - others (as long as sniff is allowed)*/
-    {360, 160, 1600}, /* BTA_DM_PM_SSR3 - HD */
-    {1200, 65534, 65534} /* BTA_DM_PM_SSR4 - A2DP streaming */
+    {0, 0, 2, "hid_host"},
+    {1200, 2, 2, "sniff_capable"},  /* BTA_DM_PM_SSR2 - others (as long as sniff
+                                       is allowed)*/
+    {360, 160, 1600, "hid_device"}, /* BTA_DM_PM_SSR3 - HD */
+    {1200, 65534, 65534, "a2dp"}    /* BTA_DM_PM_SSR4 - A2DP streaming */
 };
 
 tBTA_DM_SSR_SPEC* p_bta_dm_ssr_spec = &bta_dm_ssr_spec[0];
index 5a6e4ae..8f0c477 100644 (file)
@@ -396,6 +396,7 @@ typedef struct {
   uint16_t max_lat;
   uint16_t min_rmt_to;
   uint16_t min_loc_to;
+  const char* name{nullptr};
 } tBTA_DM_SSR_SPEC;
 
 typedef struct {