@@ -196,6 +196,32 @@ bt_status_t btc_storage_load_bonded_devices(void)
196
196
BTC_TRACE_DEBUG ("Storage load rslt %d\n" , status );
197
197
return status ;
198
198
}
199
+
200
+ /*******************************************************************************
201
+ **
202
+ ** Function btc_storage_update_active_device
203
+ **
204
+ ** Description BTC storage API - Once an ACL link is established and remote
205
+ ** bd_addr is already stored in NVRAM, update the config and update
206
+ ** the remote device to be the newest active device, The updates will
207
+ ** not be stored into NVRAM immediately.
208
+ **
209
+ ** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
210
+ **
211
+ *******************************************************************************/
212
+ bool btc_storage_update_active_device (bt_bdaddr_t * remote_bd_addr )
213
+ {
214
+ bdstr_t bdstr ;
215
+ bdaddr_to_string (remote_bd_addr , bdstr , sizeof (bdstr ));
216
+ bool ret = false;
217
+ BTC_TRACE_DEBUG ("Update active device: Remote device:%s\n" , bdstr );
218
+
219
+ btc_config_lock ();
220
+ ret = btc_config_update_newest_section (bdstr );
221
+ btc_config_unlock ();
222
+
223
+ return ret ? BT_STATUS_SUCCESS : BT_STATUS_FAIL ;
224
+ }
199
225
#endif ///SMP_INCLUDED == TRUE
200
226
201
227
/*******************************************************************************
@@ -308,32 +334,6 @@ bt_status_t btc_storage_get_bonded_bt_devices_list(bt_bdaddr_t *bond_dev, int *d
308
334
return BT_STATUS_SUCCESS ;
309
335
}
310
336
311
- /*******************************************************************************
312
- **
313
- ** Function btc_storage_update_active_device
314
- **
315
- ** Description BTC storage API - Once an ACL link is established and remote
316
- ** bd_addr is already stored in NVRAM, update the config and update
317
- ** the remote device to be the newest active device, The updates will
318
- ** not be stored into NVRAM immediately.
319
- **
320
- ** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
321
- **
322
- *******************************************************************************/
323
- bool btc_storage_update_active_device (bt_bdaddr_t * remote_bd_addr )
324
- {
325
- bdstr_t bdstr ;
326
- bdaddr_to_string (remote_bd_addr , bdstr , sizeof (bdstr ));
327
- bool ret = false;
328
- BTC_TRACE_DEBUG ("Update active device: Remote device:%s\n" , bdstr );
329
-
330
- btc_config_lock ();
331
- ret = btc_config_update_newest_section (bdstr );
332
- btc_config_unlock ();
333
-
334
- return ret ? BT_STATUS_SUCCESS : BT_STATUS_FAIL ;
335
- }
336
-
337
337
#if (defined BTC_HH_INCLUDED && BTC_HH_INCLUDED == TRUE )
338
338
/*******************************************************************************
339
339
*
0 commit comments