OSDN Git Service

Move stack/btm/btm_ble_addr::btm_ble_refresh_raddr_timer_timeout
authorChris Manton <cmanton@google.com>
Sun, 20 Sep 2020 00:22:05 +0000 (17:22 -0700)
committerChris Manton <cmanton@google.com>
Fri, 25 Sep 2020 05:15:39 +0000 (22:15 -0700)
From: stack/btm/btm_ble_gap::btm_ble_refresh_raddr_timer_timeout

Group functionality within same file

Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: Ida81c42548b377ecada80bfe7e94f0e4fa45721a

stack/btm/btm_ble_addr.cc
stack/btm/btm_ble_gap.cc
stack/btm/btm_ble_int.h

index e7d467f..ca2180c 100644 (file)
@@ -59,6 +59,13 @@ RawAddress generate_rpa_from_irk_and_rand(const Octet16& irk,
   return address;
 }
 
+static void btm_ble_refresh_raddr_timer_timeout(UNUSED_ATTR void* data) {
+  if (btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM) {
+    /* refresh the random addr */
+    btm_gen_resolvable_private_addr(base::Bind(&btm_gen_resolve_paddr_low));
+  }
+}
+
 /** This function is called when random address for local controller was
  * generated */
 void btm_gen_resolve_paddr_low(const RawAddress& address) {
index d0a239e..bab85cc 100644 (file)
@@ -2163,13 +2163,6 @@ static void btm_ble_observer_timer_timeout(UNUSED_ATTR void* data) {
   btm_ble_stop_observe();
 }
 
-void btm_ble_refresh_raddr_timer_timeout(UNUSED_ATTR void* data) {
-  if (btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM) {
-    /* refresh the random addr */
-    btm_gen_resolvable_private_addr(base::Bind(&btm_gen_resolve_paddr_low));
-  }
-}
-
 /*******************************************************************************
  *
  * Function         btm_ble_read_remote_features_complete
index ab677b0..8ff0e5d 100644 (file)
@@ -35,7 +35,6 @@
 #include "hcidefs.h"
 #include "smp_api.h"
 
-extern void btm_ble_refresh_raddr_timer_timeout(void* data);
 extern void btm_ble_process_periodic_adv_sync_est_evt(uint8_t len, uint8_t* p);
 extern void btm_ble_process_periodic_adv_pkt(uint8_t len, uint8_t* p);
 extern void btm_ble_process_periodic_adv_sync_lost_evt(uint8_t len, uint8_t* p);