mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
component/bt: remove some error logs which are not error
This commit is contained in:
@@ -546,7 +546,7 @@ static void bta_av_proc_stream_evt(UINT8 handle, BD_ADDR bd_addr, UINT8 event, t
|
|||||||
if (p_data) {
|
if (p_data) {
|
||||||
bta_av_conn_cback(handle, bd_addr, event, p_data);
|
bta_av_conn_cback(handle, bd_addr, event, p_data);
|
||||||
} else {
|
} else {
|
||||||
APPL_TRACE_ERROR("%s: p_data is null", __func__);
|
APPL_TRACE_EVENT("%s: p_data is null", __func__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -474,7 +474,7 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
|
|||||||
p_scb->rc_handle = p_data->rc_conn_chg.handle;
|
p_scb->rc_handle = p_data->rc_conn_chg.handle;
|
||||||
APPL_TRACE_DEBUG("bta_av_rc_opened shdl:%d, srch %d", i + 1, p_scb->rc_handle);
|
APPL_TRACE_DEBUG("bta_av_rc_opened shdl:%d, srch %d", i + 1, p_scb->rc_handle);
|
||||||
shdl = i + 1;
|
shdl = i + 1;
|
||||||
LOG_INFO("%s allow incoming AVRCP connections:%d", __func__, p_scb->use_rc);
|
APPL_TRACE_EVENT("%s allow incoming AVRCP connections:%d", __func__, p_scb->use_rc);
|
||||||
bta_sys_stop_timer(&p_scb->timer);
|
bta_sys_stop_timer(&p_scb->timer);
|
||||||
disc = p_scb->hndl;
|
disc = p_scb->hndl;
|
||||||
break;
|
break;
|
||||||
@@ -506,7 +506,7 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
|
|||||||
|
|
||||||
p_cb->rcb[i].shdl = shdl;
|
p_cb->rcb[i].shdl = shdl;
|
||||||
rc_open.rc_handle = i;
|
rc_open.rc_handle = i;
|
||||||
APPL_TRACE_ERROR("bta_av_rc_opened rcb[%d] shdl:%d lidx:%d/%d",
|
APPL_TRACE_EVENT("bta_av_rc_opened rcb[%d] shdl:%d lidx:%d/%d",
|
||||||
i, shdl, p_cb->rcb[i].lidx, p_cb->lcb[BTA_AV_NUM_LINKS].lidx);
|
i, shdl, p_cb->rcb[i].lidx, p_cb->lcb[BTA_AV_NUM_LINKS].lidx);
|
||||||
p_cb->rcb[i].status |= BTA_AV_RC_CONN_MASK;
|
p_cb->rcb[i].status |= BTA_AV_RC_CONN_MASK;
|
||||||
|
|
||||||
|
@@ -3118,7 +3118,7 @@ static BOOLEAN bta_dm_check_av(UINT16 event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
APPL_TRACE_WARNING("bta_dm_check_av:%d", bta_dm_cb.cur_av_count);
|
APPL_TRACE_EVENT("bta_dm_check_av:%d", bta_dm_cb.cur_av_count);
|
||||||
if (bta_dm_cb.cur_av_count) {
|
if (bta_dm_cb.cur_av_count) {
|
||||||
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
|
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
|
||||||
p_dev = &bta_dm_cb.device_list.peer_device[i];
|
p_dev = &bta_dm_cb.device_list.peer_device[i];
|
||||||
@@ -3442,7 +3442,7 @@ static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id,
|
|||||||
#endif ///BTM_SSR_INCLUDED == TRUE
|
#endif ///BTM_SSR_INCLUDED == TRUE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
APPL_TRACE_WARNING("bta_dm_rm_cback:%d, status:%d", bta_dm_cb.cur_av_count, status);
|
APPL_TRACE_EVENT("bta_dm_rm_cback:%d, status:%d", bta_dm_cb.cur_av_count, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't adjust roles for each busy/idle state transition to avoid
|
/* Don't adjust roles for each busy/idle state transition to avoid
|
||||||
|
@@ -1493,7 +1493,7 @@ static void btc_a2dp_source_feeding_state_reset(void)
|
|||||||
btc_aa_src_cb.media_feeding.cfg.pcm.num_channel *
|
btc_aa_src_cb.media_feeding.cfg.pcm.num_channel *
|
||||||
BTC_MEDIA_TIME_TICK_MS) / 1000;
|
BTC_MEDIA_TIME_TICK_MS) / 1000;
|
||||||
|
|
||||||
APPL_TRACE_WARNING("pcm bytes per tick %d",
|
APPL_TRACE_EVENT("pcm bytes per tick %d",
|
||||||
(int)btc_aa_src_cb.media_feeding_state.pcm.bytes_per_tick);
|
(int)btc_aa_src_cb.media_feeding_state.pcm.bytes_per_tick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -579,23 +579,23 @@ static void btc_search_callback(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data
|
|||||||
}
|
}
|
||||||
case BTA_DM_INQ_CMPL_EVT: {
|
case BTA_DM_INQ_CMPL_EVT: {
|
||||||
param.scan_rst.num_resps = p_data->inq_cmpl.num_resps;
|
param.scan_rst.num_resps = p_data->inq_cmpl.num_resps;
|
||||||
LOG_ERROR("%s BLE observe complete. Num Resp %d\n", __FUNCTION__, p_data->inq_cmpl.num_resps);
|
LOG_DEBUG("%s BLE observe complete. Num Resp %d\n", __FUNCTION__, p_data->inq_cmpl.num_resps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BTA_DM_DISC_RES_EVT:
|
case BTA_DM_DISC_RES_EVT:
|
||||||
LOG_ERROR("BTA_DM_DISC_RES_EVT\n");
|
LOG_DEBUG("BTA_DM_DISC_RES_EVT\n");
|
||||||
break;
|
break;
|
||||||
case BTA_DM_DISC_BLE_RES_EVT:
|
case BTA_DM_DISC_BLE_RES_EVT:
|
||||||
LOG_ERROR("BTA_DM_DISC_BLE_RES_EVT\n");
|
LOG_DEBUG("BTA_DM_DISC_BLE_RES_EVT\n");
|
||||||
break;
|
break;
|
||||||
case BTA_DM_DISC_CMPL_EVT:
|
case BTA_DM_DISC_CMPL_EVT:
|
||||||
LOG_ERROR("BTA_DM_DISC_CMPL_EVT\n");
|
LOG_DEBUG("BTA_DM_DISC_CMPL_EVT\n");
|
||||||
break;
|
break;
|
||||||
case BTA_DM_DI_DISC_CMPL_EVT:
|
case BTA_DM_DI_DISC_CMPL_EVT:
|
||||||
LOG_ERROR("BTA_DM_DI_DISC_CMPL_EVT\n");
|
LOG_DEBUG("BTA_DM_DI_DISC_CMPL_EVT\n");
|
||||||
break;
|
break;
|
||||||
case BTA_DM_SEARCH_CANCEL_CMPL_EVT:
|
case BTA_DM_SEARCH_CANCEL_CMPL_EVT:
|
||||||
LOG_ERROR("BTA_DM_SEARCH_CANCEL_CMPL_EVT\n");
|
LOG_DEBUG("BTA_DM_SEARCH_CANCEL_CMPL_EVT\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_ERROR("%s : Unknown event 0x%x\n", __FUNCTION__, event);
|
LOG_ERROR("%s : Unknown event 0x%x\n", __FUNCTION__, event);
|
||||||
|
@@ -29,7 +29,7 @@ static inline void btc_gattc_cb_to_app(esp_gattc_cb_event_t event, esp_gatt_if_t
|
|||||||
esp_gattc_cb_t btc_gattc_cb = (esp_gattc_cb_t )btc_profile_cb_get(BTC_PID_GATTC);
|
esp_gattc_cb_t btc_gattc_cb = (esp_gattc_cb_t )btc_profile_cb_get(BTC_PID_GATTC);
|
||||||
if (btc_gattc_cb) {
|
if (btc_gattc_cb) {
|
||||||
btc_gattc_cb(event, gattc_if, param);
|
btc_gattc_cb(event, gattc_if, param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void btc_gattc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
void btc_gattc_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||||
@@ -128,7 +128,7 @@ static void btc_gattc_copy_req_data(btc_msg_t *msg, void *p_dest, void *p_src)
|
|||||||
// Allocate buffer for request data if necessary
|
// Allocate buffer for request data if necessary
|
||||||
switch (msg->act) {
|
switch (msg->act) {
|
||||||
case BTA_GATTC_READ_DESCR_EVT:
|
case BTA_GATTC_READ_DESCR_EVT:
|
||||||
case BTA_GATTC_READ_CHAR_EVT:
|
case BTA_GATTC_READ_CHAR_EVT:
|
||||||
case BTA_GATTC_READ_MUTIPLE_EVT: {
|
case BTA_GATTC_READ_MUTIPLE_EVT: {
|
||||||
if (p_src_data->read.p_value && p_src_data->read.p_value->p_value) {
|
if (p_src_data->read.p_value && p_src_data->read.p_value->p_value) {
|
||||||
p_dest_data->read.p_value = (tBTA_GATT_UNFMT *)osi_malloc(sizeof(tBTA_GATT_UNFMT) + p_src_data->read.p_value->len);
|
p_dest_data->read.p_value = (tBTA_GATT_UNFMT *)osi_malloc(sizeof(tBTA_GATT_UNFMT) + p_src_data->read.p_value->len);
|
||||||
@@ -141,7 +141,7 @@ static void btc_gattc_copy_req_data(btc_msg_t *msg, void *p_dest, void *p_src)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ static void btc_gattc_free_req_data(btc_msg_t *msg)
|
|||||||
tBTA_GATTC *arg = (tBTA_GATTC *)(msg->arg);
|
tBTA_GATTC *arg = (tBTA_GATTC *)(msg->arg);
|
||||||
switch (msg->act) {
|
switch (msg->act) {
|
||||||
case BTA_GATTC_READ_DESCR_EVT:
|
case BTA_GATTC_READ_DESCR_EVT:
|
||||||
case BTA_GATTC_READ_CHAR_EVT:
|
case BTA_GATTC_READ_CHAR_EVT:
|
||||||
case BTA_GATTC_READ_MUTIPLE_EVT: {
|
case BTA_GATTC_READ_MUTIPLE_EVT: {
|
||||||
if (arg->read.p_value) {
|
if (arg->read.p_value) {
|
||||||
osi_free(arg->read.p_value);
|
osi_free(arg->read.p_value);
|
||||||
@@ -290,7 +290,7 @@ static void btc_gattc_search_service(btc_ble_gattc_args_t *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_gatt_status_t btc_ble_gattc_get_service(uint16_t conn_id, esp_bt_uuid_t *svc_uuid,
|
esp_gatt_status_t btc_ble_gattc_get_service(uint16_t conn_id, esp_bt_uuid_t *svc_uuid,
|
||||||
esp_gattc_service_elem_t *result,
|
esp_gattc_service_elem_t *result,
|
||||||
uint16_t *count, uint16_t offset)
|
uint16_t *count, uint16_t offset)
|
||||||
{
|
{
|
||||||
@@ -302,7 +302,7 @@ esp_gatt_status_t btc_ble_gattc_get_service(uint16_t conn_id, esp_bt_uuid_t *svc
|
|||||||
bta_uuid = osi_malloc(sizeof(tBT_UUID));
|
bta_uuid = osi_malloc(sizeof(tBT_UUID));
|
||||||
btc_to_bta_uuid(bta_uuid, svc_uuid);
|
btc_to_bta_uuid(bta_uuid, svc_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
BTA_GATTC_GetServiceWithUUID(conn_id, bta_uuid, &db, &svc_num);
|
BTA_GATTC_GetServiceWithUUID(conn_id, bta_uuid, &db, &svc_num);
|
||||||
|
|
||||||
if ((status = btc_gattc_check_valid_param(svc_num, offset)) != ESP_GATT_OK) {
|
if ((status = btc_gattc_check_valid_param(svc_num, offset)) != ESP_GATT_OK) {
|
||||||
@@ -312,7 +312,7 @@ esp_gatt_status_t btc_ble_gattc_get_service(uint16_t conn_id, esp_bt_uuid_t *svc
|
|||||||
if (bta_uuid) {
|
if (bta_uuid) {
|
||||||
osi_free(bta_uuid);
|
osi_free(bta_uuid);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else {
|
} else {
|
||||||
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)svc_num, ESP_GATT_DB_PRIMARY_SERVICE, offset, (void *)result, db);
|
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)svc_num, ESP_GATT_DB_PRIMARY_SERVICE, offset, (void *)result, db);
|
||||||
}
|
}
|
||||||
@@ -370,7 +370,7 @@ esp_gatt_status_t btc_ble_gattc_get_all_descr(uint16_t conn_id,
|
|||||||
if (db) {
|
if (db) {
|
||||||
osi_free(db);
|
osi_free(db);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else {
|
} else {
|
||||||
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)descr_num, ESP_GATT_DB_DESCRIPTOR, offset, (void *)result, db);
|
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)descr_num, ESP_GATT_DB_DESCRIPTOR, offset, (void *)result, db);
|
||||||
}
|
}
|
||||||
@@ -387,7 +387,7 @@ esp_gatt_status_t btc_ble_gattc_get_char_by_uuid(uint16_t conn_id,
|
|||||||
uint16_t start_handle,
|
uint16_t start_handle,
|
||||||
uint16_t end_handle,
|
uint16_t end_handle,
|
||||||
esp_bt_uuid_t char_uuid,
|
esp_bt_uuid_t char_uuid,
|
||||||
esp_gattc_char_elem_t *result,
|
esp_gattc_char_elem_t *result,
|
||||||
uint16_t *count)
|
uint16_t *count)
|
||||||
{
|
{
|
||||||
esp_gatt_status_t status;
|
esp_gatt_status_t status;
|
||||||
@@ -419,7 +419,7 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_uuid(uint16_t conn_id,
|
|||||||
uint16_t end_handle,
|
uint16_t end_handle,
|
||||||
esp_bt_uuid_t char_uuid,
|
esp_bt_uuid_t char_uuid,
|
||||||
esp_bt_uuid_t descr_uuid,
|
esp_bt_uuid_t descr_uuid,
|
||||||
esp_gattc_descr_elem_t *result,
|
esp_gattc_descr_elem_t *result,
|
||||||
uint16_t *count)
|
uint16_t *count)
|
||||||
{
|
{
|
||||||
esp_gatt_status_t status;
|
esp_gatt_status_t status;
|
||||||
@@ -429,8 +429,8 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_uuid(uint16_t conn_id,
|
|||||||
tBT_UUID bta_descr_uuid = {0};
|
tBT_UUID bta_descr_uuid = {0};
|
||||||
btc_to_bta_uuid(&bta_char_uuid, &char_uuid);
|
btc_to_bta_uuid(&bta_char_uuid, &char_uuid);
|
||||||
btc_to_bta_uuid(&bta_descr_uuid, &descr_uuid);
|
btc_to_bta_uuid(&bta_descr_uuid, &descr_uuid);
|
||||||
|
|
||||||
BTA_GATTC_GetDescrByUUID(conn_id, start_handle, end_handle,
|
BTA_GATTC_GetDescrByUUID(conn_id, start_handle, end_handle,
|
||||||
bta_char_uuid, bta_descr_uuid, &db, &descr_num);
|
bta_char_uuid, bta_descr_uuid, &db, &descr_num);
|
||||||
|
|
||||||
if ((status = btc_gattc_check_valid_param(descr_num, 0)) != ESP_GATT_OK) {
|
if ((status = btc_gattc_check_valid_param(descr_num, 0)) != ESP_GATT_OK) {
|
||||||
@@ -441,7 +441,7 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_uuid(uint16_t conn_id,
|
|||||||
} else {
|
} else {
|
||||||
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)descr_num, ESP_GATT_DB_DESCRIPTOR, 0, (void *)result, db);
|
btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)descr_num, ESP_GATT_DB_DESCRIPTOR, 0, (void *)result, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
*count = descr_num;
|
*count = descr_num;
|
||||||
//don't forget to free the db buffer after used.
|
//don't forget to free the db buffer after used.
|
||||||
if (db) {
|
if (db) {
|
||||||
@@ -461,7 +461,7 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_char_handle(uint16_t conn_id,
|
|||||||
int descr_num = 0;
|
int descr_num = 0;
|
||||||
tBT_UUID bta_descr_uuid = {0};
|
tBT_UUID bta_descr_uuid = {0};
|
||||||
btc_to_bta_uuid(&bta_descr_uuid, &descr_uuid);
|
btc_to_bta_uuid(&bta_descr_uuid, &descr_uuid);
|
||||||
|
|
||||||
BTA_GATTC_GetDescrByCharHandle(conn_id, char_handle, bta_descr_uuid, &db, &descr_num);
|
BTA_GATTC_GetDescrByCharHandle(conn_id, char_handle, bta_descr_uuid, &db, &descr_num);
|
||||||
|
|
||||||
if ((status = btc_gattc_check_valid_param(descr_num, 0)) != ESP_GATT_OK) {
|
if ((status = btc_gattc_check_valid_param(descr_num, 0)) != ESP_GATT_OK) {
|
||||||
@@ -479,7 +479,7 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_char_handle(uint16_t conn_id,
|
|||||||
osi_free(db);
|
osi_free(db);
|
||||||
}
|
}
|
||||||
return ESP_GATT_OK;
|
return ESP_GATT_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_gatt_status_t btc_ble_gattc_get_include_service(uint16_t conn_id,
|
esp_gatt_status_t btc_ble_gattc_get_include_service(uint16_t conn_id,
|
||||||
@@ -588,7 +588,7 @@ static void btc_gattc_read_char_descr(btc_ble_gattc_args_t *arg)
|
|||||||
|
|
||||||
static void btc_gattc_write_char(btc_ble_gattc_args_t *arg)
|
static void btc_gattc_write_char(btc_ble_gattc_args_t *arg)
|
||||||
{
|
{
|
||||||
BTA_GATTC_WriteCharValue(arg->write_char.conn_id,
|
BTA_GATTC_WriteCharValue(arg->write_char.conn_id,
|
||||||
arg->write_char.handle,
|
arg->write_char.handle,
|
||||||
arg->write_char.write_type,
|
arg->write_char.write_type,
|
||||||
arg->write_char.value_len,
|
arg->write_char.value_len,
|
||||||
@@ -603,7 +603,7 @@ static void btc_gattc_write_char_descr(btc_ble_gattc_args_t *arg)
|
|||||||
descr_val.len = arg->write_descr.value_len;
|
descr_val.len = arg->write_descr.value_len;
|
||||||
descr_val.p_value = arg->write_descr.value;
|
descr_val.p_value = arg->write_descr.value;
|
||||||
|
|
||||||
BTA_GATTC_WriteCharDescr(arg->write_descr.conn_id,
|
BTA_GATTC_WriteCharDescr(arg->write_descr.conn_id,
|
||||||
arg->write_descr.handle,
|
arg->write_descr.handle,
|
||||||
arg->write_descr.write_type, &descr_val,
|
arg->write_descr.write_type, &descr_val,
|
||||||
arg->write_descr.auth_req);
|
arg->write_descr.auth_req);
|
||||||
@@ -671,7 +671,6 @@ void btc_gattc_call_handler(btc_msg_t *msg)
|
|||||||
btc_ble_gattc_args_t *arg = (btc_ble_gattc_args_t *)(msg->arg);
|
btc_ble_gattc_args_t *arg = (btc_ble_gattc_args_t *)(msg->arg);
|
||||||
switch (msg->act) {
|
switch (msg->act) {
|
||||||
case BTC_GATTC_ACT_APP_REGISTER:
|
case BTC_GATTC_ACT_APP_REGISTER:
|
||||||
LOG_ERROR("%s()", __func__);
|
|
||||||
btc_gattc_app_register(arg);
|
btc_gattc_app_register(arg);
|
||||||
break;
|
break;
|
||||||
case BTC_GATTC_ACT_APP_UNREGISTER:
|
case BTC_GATTC_ACT_APP_UNREGISTER:
|
||||||
|
@@ -377,16 +377,16 @@ void avct_lcb_bind_conn(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void avct_lcb_chk_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
|
void avct_lcb_chk_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
|
||||||
{
|
{
|
||||||
AVCT_TRACE_WARNING("avct_lcb_chk_disc");
|
AVCT_TRACE_EVENT("avct_lcb_chk_disc");
|
||||||
#if (AVCT_BROWSE_INCLUDED == TRUE)
|
#if (AVCT_BROWSE_INCLUDED == TRUE)
|
||||||
avct_close_bcb(p_lcb, p_data);
|
avct_close_bcb(p_lcb, p_data);
|
||||||
#endif
|
#endif
|
||||||
if (avct_lcb_last_ccb(p_lcb, p_data->p_ccb)) {
|
if (avct_lcb_last_ccb(p_lcb, p_data->p_ccb)) {
|
||||||
AVCT_TRACE_WARNING("closing");
|
AVCT_TRACE_EVENT("closing");
|
||||||
p_data->p_ccb->ch_close = TRUE;
|
p_data->p_ccb->ch_close = TRUE;
|
||||||
avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
|
avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
|
||||||
} else {
|
} else {
|
||||||
AVCT_TRACE_WARNING("dealloc ccb");
|
AVCT_TRACE_EVENT("dealloc ccb");
|
||||||
avct_lcb_unbind_disc(p_lcb, p_data);
|
avct_lcb_unbind_disc(p_lcb, p_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2598,7 +2598,6 @@ tBTM_STATUS btm_sec_mx_access_request (BD_ADDR bd_addr, UINT16 psm, BOOLEAN is_o
|
|||||||
void btm_sec_conn_req (UINT8 *bda, UINT8 *dc)
|
void btm_sec_conn_req (UINT8 *bda, UINT8 *dc)
|
||||||
{
|
{
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bda);
|
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bda);
|
||||||
BTM_TRACE_ERROR ("%s\n", __func__);
|
|
||||||
/* Some device may request a connection before we are done with the HCI_Reset sequence */
|
/* Some device may request a connection before we are done with the HCI_Reset sequence */
|
||||||
if (!controller_get_interface()->get_is_ready()) {
|
if (!controller_get_interface()->get_is_ready()) {
|
||||||
BTM_TRACE_ERROR ("Security Manager: connect request when device not ready\n");
|
BTM_TRACE_ERROR ("Security Manager: connect request when device not ready\n");
|
||||||
@@ -4209,7 +4208,6 @@ void btm_sec_connected (UINT8 *bda, UINT16 handle, UINT8 status, UINT8 enc_mode)
|
|||||||
|
|
||||||
btm_acl_resubmit_page();
|
btm_acl_resubmit_page();
|
||||||
|
|
||||||
BTM_TRACE_ERROR ("%s\n", __func__);
|
|
||||||
/* Commenting out trace due to obf/compilation problems.
|
/* Commenting out trace due to obf/compilation problems.
|
||||||
*/
|
*/
|
||||||
#if (BT_USE_TRACES == TRUE && SMP_INCLUDED == TRUE)
|
#if (BT_USE_TRACES == TRUE && SMP_INCLUDED == TRUE)
|
||||||
@@ -5971,7 +5969,7 @@ static void btm_sec_check_pending_enc_req (tBTM_SEC_DEV_REC *p_dev_rec, tBT_TRA
|
|||||||
if (p_e->p_callback) {
|
if (p_e->p_callback) {
|
||||||
(*p_e->p_callback) (p_dev_rec->bd_addr, transport, p_e->p_ref_data, res);
|
(*p_e->p_callback) (p_dev_rec->bd_addr, transport, p_e->p_ref_data, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_queue_try_remove_from_queue(btm_cb.sec_pending_q, (void *)p_e);
|
fixed_queue_try_remove_from_queue(btm_cb.sec_pending_q, (void *)p_e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -656,7 +656,7 @@ static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
|
|||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
#if (SDP_RAW_DATA_INCLUDED == TRUE)
|
#if (SDP_RAW_DATA_INCLUDED == TRUE)
|
||||||
SDP_TRACE_WARNING("process_service_search_attr_rsp\n");
|
SDP_TRACE_DEBUG("process_service_search_attr_rsp\n");
|
||||||
sdp_copy_raw_data (p_ccb, TRUE);
|
sdp_copy_raw_data (p_ccb, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -123,7 +123,7 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
|
|||||||
sample_rate = 48000;
|
sample_rate = 48000;
|
||||||
}
|
}
|
||||||
i2s_set_clk(0, sample_rate, 16, 2);
|
i2s_set_clk(0, sample_rate, 16, 2);
|
||||||
|
|
||||||
ESP_LOGI(BT_AV_TAG, "Configure audio player %x-%x-%x-%x",
|
ESP_LOGI(BT_AV_TAG, "Configure audio player %x-%x-%x-%x",
|
||||||
a2d->audio_cfg.mcc.cie.sbc[0],
|
a2d->audio_cfg.mcc.cie.sbc[0],
|
||||||
a2d->audio_cfg.mcc.cie.sbc[1],
|
a2d->audio_cfg.mcc.cie.sbc[1],
|
||||||
|
@@ -320,7 +320,7 @@ static void a2d_app_heart_beat(void *arg)
|
|||||||
|
|
||||||
static void bt_app_av_sm_hdlr(uint16_t event, void *param)
|
static void bt_app_av_sm_hdlr(uint16_t event, void *param)
|
||||||
{
|
{
|
||||||
ESP_LOGE(BT_AV_TAG, "%s state %d, evt 0x%x", __func__, m_a2d_state, event);
|
ESP_LOGI(BT_AV_TAG, "%s state %d, evt 0x%x", __func__, m_a2d_state, event);
|
||||||
switch (m_a2d_state) {
|
switch (m_a2d_state) {
|
||||||
case APP_AV_STATE_DISCOVERING:
|
case APP_AV_STATE_DISCOVERING:
|
||||||
case APP_AV_STATE_DISCOVERED:
|
case APP_AV_STATE_DISCOVERED:
|
||||||
|
@@ -307,7 +307,7 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
|||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_GATTC_REG_EVT:
|
case ESP_GATTC_REG_EVT:
|
||||||
ESP_LOGE(GATTC_TAG, "REG EVT, set scan params");
|
ESP_LOGI(GATTC_TAG, "REG EVT, set scan params");
|
||||||
esp_ble_gap_set_scan_params(&ble_scan_params);
|
esp_ble_gap_set_scan_params(&ble_scan_params);
|
||||||
break;
|
break;
|
||||||
case ESP_GATTC_CONNECT_EVT:
|
case ESP_GATTC_CONNECT_EVT:
|
||||||
|
@@ -461,7 +461,7 @@ static void spp_task_init(void)
|
|||||||
|
|
||||||
static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
||||||
{
|
{
|
||||||
ESP_LOGE(GATTS_TABLE_TAG, "GAP_EVT, event %d\n", event);
|
ESP_LOGI(GATTS_TABLE_TAG, "GAP_EVT, event %d\n", event);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT:
|
case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT:
|
||||||
@@ -483,7 +483,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
|
|||||||
esp_ble_gatts_cb_param_t *p_data = (esp_ble_gatts_cb_param_t *) param;
|
esp_ble_gatts_cb_param_t *p_data = (esp_ble_gatts_cb_param_t *) param;
|
||||||
uint8_t res = 0xff;
|
uint8_t res = 0xff;
|
||||||
|
|
||||||
ESP_LOGE(GATTS_TABLE_TAG, "event = %x\n",event);
|
ESP_LOGI(GATTS_TABLE_TAG, "event = %x\n",event);
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_GATTS_REG_EVT:
|
case ESP_GATTS_REG_EVT:
|
||||||
ESP_LOGI(GATTS_TABLE_TAG, "%s %d\n", __func__, __LINE__);
|
ESP_LOGI(GATTS_TABLE_TAG, "%s %d\n", __func__, __LINE__);
|
||||||
@@ -633,7 +633,7 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int idx;
|
int idx;
|
||||||
for (idx = 0; idx < SPP_PROFILE_NUM; idx++) {
|
for (idx = 0; idx < SPP_PROFILE_NUM; idx++) {
|
||||||
|
@@ -361,7 +361,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
|
|||||||
break;
|
break;
|
||||||
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: ///the app will receive this evt when the IO has Output capability and the peer device IO has Input capability.
|
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: ///the app will receive this evt when the IO has Output capability and the peer device IO has Input capability.
|
||||||
///show the passkey number to the user to input it in the peer deivce.
|
///show the passkey number to the user to input it in the peer deivce.
|
||||||
ESP_LOGE(GATTC_TAG, "The passkey Notify number:%d", param->ble_security.key_notif.passkey);
|
ESP_LOGI(GATTC_TAG, "The passkey Notify number:%d", param->ble_security.key_notif.passkey);
|
||||||
break;
|
break;
|
||||||
case ESP_GAP_BLE_KEY_EVT:
|
case ESP_GAP_BLE_KEY_EVT:
|
||||||
//shows the ble key info share with peer device to the user.
|
//shows the ble key info share with peer device to the user.
|
||||||
@@ -524,7 +524,7 @@ void app_main()
|
|||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
|
||||||
/* If your BLE device act as a Slave, the init_key means you hope which types of key of the master should distribut to you,
|
/* If your BLE device act as a Slave, the init_key means you hope which types of key of the master should distribut to you,
|
||||||
and the response key means which key you can distribut to the Master;
|
and the response key means which key you can distribut to the Master;
|
||||||
If your BLE device act as a master, the response key means you hope which types of key of the slave should distribut to you,
|
If your BLE device act as a master, the response key means you hope which types of key of the slave should distribut to you,
|
||||||
and the init key means which key you can distribut to the slave. */
|
and the init key means which key you can distribut to the slave. */
|
||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
|
||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));
|
||||||
|
@@ -40,7 +40,7 @@ uint8_t heart_str[] = {0x11,0x22,0x33};
|
|||||||
|
|
||||||
uint16_t heart_rate_handle_table[HRS_IDX_NB];
|
uint16_t heart_rate_handle_table[HRS_IDX_NB];
|
||||||
|
|
||||||
esp_attr_value_t gatts_demo_char1_val =
|
esp_attr_value_t gatts_demo_char1_val =
|
||||||
{
|
{
|
||||||
.attr_max_len = GATTS_DEMO_CHAR_VAL_LEN_MAX,
|
.attr_max_len = GATTS_DEMO_CHAR_VAL_LEN_MAX,
|
||||||
.attr_len = sizeof(heart_str),
|
.attr_len = sizeof(heart_str),
|
||||||
@@ -101,7 +101,7 @@ struct gatts_profile_inst {
|
|||||||
esp_bt_uuid_t descr_uuid;
|
esp_bt_uuid_t descr_uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gatts_profile_event_handler(esp_gatts_cb_event_t event,
|
static void gatts_profile_event_handler(esp_gatts_cb_event_t event,
|
||||||
esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
|
esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
|
||||||
|
|
||||||
/* One gatt-based profile one app_id and one gatts_if, this array will store the gatts_if returned by ESP_GATTS_REG_EVT */
|
/* One gatt-based profile one app_id and one gatts_if, this array will store the gatts_if returned by ESP_GATTS_REG_EVT */
|
||||||
@@ -147,44 +147,44 @@ static const uint8_t heart_ctrl_point[1] = {0x00};
|
|||||||
static const esp_gatts_attr_db_t heart_rate_gatt_db[HRS_IDX_NB] =
|
static const esp_gatts_attr_db_t heart_rate_gatt_db[HRS_IDX_NB] =
|
||||||
{
|
{
|
||||||
// Heart Rate Service Declaration
|
// Heart Rate Service Declaration
|
||||||
[HRS_IDX_SVC] =
|
[HRS_IDX_SVC] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ,
|
||||||
sizeof(uint16_t), sizeof(heart_rate_svc), (uint8_t *)&heart_rate_svc}},
|
sizeof(uint16_t), sizeof(heart_rate_svc), (uint8_t *)&heart_rate_svc}},
|
||||||
|
|
||||||
// Heart Rate Measurement Characteristic Declaration
|
// Heart Rate Measurement Characteristic Declaration
|
||||||
[HRS_IDX_HR_MEAS_CHAR] =
|
[HRS_IDX_HR_MEAS_CHAR] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
||||||
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_notify}},
|
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_notify}},
|
||||||
|
|
||||||
// Heart Rate Measurement Characteristic Value
|
// Heart Rate Measurement Characteristic Value
|
||||||
[HRS_IDX_HR_MEAS_VAL] =
|
[HRS_IDX_HR_MEAS_VAL] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&heart_rate_meas_uuid, ESP_GATT_PERM_READ,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&heart_rate_meas_uuid, ESP_GATT_PERM_READ,
|
||||||
HRPS_HT_MEAS_MAX_LEN,0, NULL}},
|
HRPS_HT_MEAS_MAX_LEN,0, NULL}},
|
||||||
|
|
||||||
// Heart Rate Measurement Characteristic - Client Characteristic Configuration Descriptor
|
// Heart Rate Measurement Characteristic - Client Characteristic Configuration Descriptor
|
||||||
[HRS_IDX_HR_MEAS_NTF_CFG] =
|
[HRS_IDX_HR_MEAS_NTF_CFG] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ|ESP_GATT_PERM_WRITE,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ|ESP_GATT_PERM_WRITE,
|
||||||
sizeof(uint16_t),sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
|
sizeof(uint16_t),sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
|
||||||
|
|
||||||
// Body Sensor Location Characteristic Declaration
|
// Body Sensor Location Characteristic Declaration
|
||||||
[HRS_IDX_BOBY_SENSOR_LOC_CHAR] =
|
[HRS_IDX_BOBY_SENSOR_LOC_CHAR] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
||||||
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read}},
|
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read}},
|
||||||
|
|
||||||
// Body Sensor Location Characteristic Value
|
// Body Sensor Location Characteristic Value
|
||||||
[HRS_IDX_BOBY_SENSOR_LOC_VAL] =
|
[HRS_IDX_BOBY_SENSOR_LOC_VAL] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&body_sensor_location_uuid, ESP_GATT_PERM_READ_ENCRYPTED,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&body_sensor_location_uuid, ESP_GATT_PERM_READ_ENCRYPTED,
|
||||||
sizeof(uint8_t), sizeof(body_sensor_loc_val), (uint8_t *)body_sensor_loc_val}},
|
sizeof(uint8_t), sizeof(body_sensor_loc_val), (uint8_t *)body_sensor_loc_val}},
|
||||||
|
|
||||||
// Heart Rate Control Point Characteristic Declaration
|
// Heart Rate Control Point Characteristic Declaration
|
||||||
[HRS_IDX_HR_CTNL_PT_CHAR] =
|
[HRS_IDX_HR_CTNL_PT_CHAR] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
|
||||||
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write}},
|
CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write}},
|
||||||
|
|
||||||
// Heart Rate Control Point Characteristic Value
|
// Heart Rate Control Point Characteristic Value
|
||||||
[HRS_IDX_HR_CTNL_PT_VAL] =
|
[HRS_IDX_HR_CTNL_PT_VAL] =
|
||||||
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&heart_rate_ctrl_point, ESP_GATT_PERM_WRITE_ENCRYPTED|ESP_GATT_PERM_READ_ENCRYPTED,
|
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&heart_rate_ctrl_point, ESP_GATT_PERM_WRITE_ENCRYPTED|ESP_GATT_PERM_READ_ENCRYPTED,
|
||||||
sizeof(uint8_t), sizeof(heart_ctrl_point), (uint8_t *)heart_ctrl_point}},
|
sizeof(uint8_t), sizeof(heart_ctrl_point), (uint8_t *)heart_ctrl_point}},
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *esp_key_type_to_str(esp_ble_key_type_t key_type)
|
static char *esp_key_type_to_str(esp_ble_key_type_t key_type)
|
||||||
@@ -304,7 +304,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param
|
|||||||
break;
|
break;
|
||||||
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: ///the app will receive this evt when the IO has Output capability and the peer device IO has Input capability.
|
case ESP_GAP_BLE_PASSKEY_NOTIF_EVT: ///the app will receive this evt when the IO has Output capability and the peer device IO has Input capability.
|
||||||
///show the passkey number to the user to input it in the peer deivce.
|
///show the passkey number to the user to input it in the peer deivce.
|
||||||
ESP_LOGE(GATTS_TABLE_TAG, "The passkey Notify number:%d", param->ble_security.key_notif.passkey);
|
ESP_LOGI(GATTS_TABLE_TAG, "The passkey Notify number:%d", param->ble_security.key_notif.passkey);
|
||||||
break;
|
break;
|
||||||
case ESP_GAP_BLE_KEY_EVT:
|
case ESP_GAP_BLE_KEY_EVT:
|
||||||
//shows the ble key info share with peer device to the user.
|
//shows the ble key info share with peer device to the user.
|
||||||
@@ -369,7 +369,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event,
|
|||||||
break;
|
break;
|
||||||
case ESP_GATTS_READ_EVT:
|
case ESP_GATTS_READ_EVT:
|
||||||
break;
|
break;
|
||||||
case ESP_GATTS_WRITE_EVT:
|
case ESP_GATTS_WRITE_EVT:
|
||||||
ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_WRITE_EVT, write value:");
|
ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_WRITE_EVT, write value:");
|
||||||
esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
|
esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
|
||||||
break;
|
break;
|
||||||
@@ -430,7 +430,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,
|
static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,
|
||||||
esp_ble_gatts_cb_param_t *param)
|
esp_ble_gatts_cb_param_t *param)
|
||||||
{
|
{
|
||||||
/* If event is register event, store the gatts_if for each profile */
|
/* If event is register event, store the gatts_if for each profile */
|
||||||
@@ -439,7 +439,7 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
|
|||||||
heart_rate_profile_tab[HEART_PROFILE_APP_IDX].gatts_if = gatts_if;
|
heart_rate_profile_tab[HEART_PROFILE_APP_IDX].gatts_if = gatts_if;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGI(GATTS_TABLE_TAG, "Reg app failed, app_id %04x, status %d\n",
|
ESP_LOGI(GATTS_TABLE_TAG, "Reg app failed, app_id %04x, status %d\n",
|
||||||
param->reg.app_id,
|
param->reg.app_id,
|
||||||
param->reg.status);
|
param->reg.status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -523,14 +523,14 @@ void app_main()
|
|||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size, sizeof(uint8_t));
|
||||||
/* If your BLE device act as a Slave, the init_key means you hope which types of key of the master should distribut to you,
|
/* If your BLE device act as a Slave, the init_key means you hope which types of key of the master should distribut to you,
|
||||||
and the response key means which key you can distribut to the Master;
|
and the response key means which key you can distribut to the Master;
|
||||||
If your BLE device act as a master, the response key means you hope which types of key of the slave should distribut to you,
|
If your BLE device act as a master, the response key means you hope which types of key of the slave should distribut to you,
|
||||||
and the init key means which key you can distribut to the slave. */
|
and the init key means which key you can distribut to the slave. */
|
||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key, sizeof(uint8_t));
|
||||||
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));
|
esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key, sizeof(uint8_t));
|
||||||
|
|
||||||
/* Just show how to clear all the bonded devices
|
/* Just show how to clear all the bonded devices
|
||||||
* Delay 30s, clear all the bonded devices
|
* Delay 30s, clear all the bonded devices
|
||||||
*
|
*
|
||||||
* vTaskDelay(30000 / portTICK_PERIOD_MS);
|
* vTaskDelay(30000 / portTICK_PERIOD_MS);
|
||||||
* remove_all_bonded_devices();
|
* remove_all_bonded_devices();
|
||||||
*/
|
*/
|
||||||
|
@@ -760,7 +760,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
|
|||||||
case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
|
case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
|
||||||
//scan start complete event to indicate scan start successfully or failed
|
//scan start complete event to indicate scan start successfully or failed
|
||||||
if (param->scan_start_cmpl.status == ESP_BT_STATUS_SUCCESS) {
|
if (param->scan_start_cmpl.status == ESP_BT_STATUS_SUCCESS) {
|
||||||
ESP_LOGE(GATTC_TAG, "Scan start success");
|
ESP_LOGI(GATTC_TAG, "Scan start success");
|
||||||
}else{
|
}else{
|
||||||
ESP_LOGE(GATTC_TAG, "Scan start failed");
|
ESP_LOGE(GATTC_TAG, "Scan start failed");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user