+32
-29
lines changedFilter options
+32
-29
lines changed Original file line number Diff line number Diff line change
@@ -712,6 +712,7 @@ static void btc_dm_acl_link_stat(tBTA_DM_ACL_LINK_STAT *p_acl_link_stat)
712
712
}
713
713
}
714
714
715
+
#if (SMP_INCLUDED == TRUE)
715
716
if (p_acl_link_stat->event == BTA_ACL_LINK_STAT_CONN_CMPL &&
716
717
p_acl_link_stat->link_act.conn_cmpl.status == HCI_SUCCESS) {
717
718
memcpy(bt_addr.address, p_acl_link_stat->link_act.conn_cmpl.bd_addr, sizeof(bt_addr.address));
@@ -722,7 +723,7 @@ static void btc_dm_acl_link_stat(tBTA_DM_ACL_LINK_STAT *p_acl_link_stat)
722
723
bt_addr.address[4], bt_addr.address[5]);
723
724
}
724
725
}
725
-
726
+
#endif ///SMP_INCLUDED == TRUE
726
727
esp_bt_gap_cb_t cb = (esp_bt_gap_cb_t)btc_profile_cb_get(BTC_PID_GAP_BT);
727
728
if (cb) {
728
729
cb(event, ¶m);
Original file line number Diff line number Diff line change
@@ -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
*
Original file line number Diff line number Diff line change
@@ -926,6 +926,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
926
926
}
927
927
case BTA_GATTC_CONNECT_EVT: {
928
928
tBTA_GATTC_CONNECT *connect = &arg->connect;
929
+
#if (SMP_INCLUDED == TRUE)
929
930
bt_bdaddr_t bt_addr;
930
931
931
932
memcpy(bt_addr.address, connect->remote_bda, sizeof(bt_addr.address));
@@ -935,7 +936,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
935
936
bt_addr.address[2], bt_addr.address[3],
936
937
bt_addr.address[4], bt_addr.address[5]);
937
938
}
938
-
939
+
#endif ///SMP_INCLUDED == TRUE
939
940
gattc_if = connect->client_if;
940
941
param.connect.conn_id = BTC_GATT_GET_CONN_ID(connect->conn_id);
941
942
param.connect.link_role = connect->link_role;
Original file line number Diff line number Diff line change
@@ -901,6 +901,7 @@ void btc_gatts_cb_handler(btc_msg_t *msg)
901
901
btc_gatts_cb_to_app(ESP_GATTS_STOP_EVT, gatts_if, ¶m);
902
902
break;
903
903
case BTA_GATTS_CONNECT_EVT: {
904
+
#if (SMP_INCLUDED == TRUE)
904
905
bt_bdaddr_t bt_addr;
905
906
memcpy(bt_addr.address, p_data->conn.remote_bda, sizeof(bt_addr.address));
906
907
if (btc_storage_update_active_device(&bt_addr)) {
@@ -909,7 +910,7 @@ void btc_gatts_cb_handler(btc_msg_t *msg)
909
910
bt_addr.address[2], bt_addr.address[3],
910
911
bt_addr.address[4], bt_addr.address[5]);
911
912
}
912
-
913
+
#endif ///SMP_INCLUDED == TRUE
913
914
gatts_if = p_data->conn.server_if;
914
915
param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id);
915
916
param.connect.link_role = p_data->conn.link_role;
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4