]> granicus.if.org Git - esp-idf/commitdiff
component/bt: remove some error logs which are not error
authorbaohongde <baohongde@espressif.com>
Wed, 17 Jan 2018 11:23:41 +0000 (19:23 +0800)
committerbaohongde <baohongde@espressif.com>
Mon, 5 Mar 2018 11:22:21 +0000 (19:22 +0800)
16 files changed:
components/bt/bluedroid/bta/av/bta_av_aact.c
components/bt/bluedroid/bta/av/bta_av_act.c
components/bt/bluedroid/bta/dm/bta_dm_act.c
components/bt/bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c
components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c
components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c
components/bt/bluedroid/stack/avct/avct_lcb_act.c
components/bt/bluedroid/stack/btm/btm_sec.c
components/bt/bluedroid/stack/sdp/sdp_discovery.c
examples/bluetooth/a2dp_sink/main/bt_app_av.c
examples/bluetooth/a2dp_source/main/main.c
examples/bluetooth/ble_spp_client/main/spp_client_demo.c
examples/bluetooth/ble_spp_server/main/ble_spp_server_demo.c
examples/bluetooth/gatt_security_client/main/example_ble_sec_gattc_demo.c
examples/bluetooth/gatt_security_server/main/example_ble_sec_gatts_demo.c
examples/bluetooth/gattc_multi_connect/main/gattc_multi_connect.c

index c0f0b3398dcf6937a49580312d3b982537ddde63..ab654e9c690a92753116c27c86fe673cca3093ba 100644 (file)
@@ -546,7 +546,7 @@ static void bta_av_proc_stream_evt(UINT8 handle, BD_ADDR bd_addr, UINT8 event, t
     if (p_data) {
         bta_av_conn_cback(handle, bd_addr, event, p_data);
     } else {
-        APPL_TRACE_ERROR("%s: p_data is null", __func__);
+        APPL_TRACE_EVENT("%s: p_data is null", __func__);
     }
 }
 
index b86875870c7e9109789181f7393d343c821faaf1..a014cf292fcef897e9984beae5a33327a108abea 100644 (file)
@@ -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;
             APPL_TRACE_DEBUG("bta_av_rc_opened shdl:%d, srch %d", i + 1, p_scb->rc_handle);
             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);
             disc = p_scb->hndl;
             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;
     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);
     p_cb->rcb[i].status |= BTA_AV_RC_CONN_MASK;
 
index a172cd80469c5283b2a27b6a48bd64529d4e1f1d..0a14a35acb2aa4c4b59bd21981b5ffeb98dd2bbd 100644 (file)
@@ -3118,7 +3118,7 @@ static BOOLEAN bta_dm_check_av(UINT16 event)
     }
 #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) {
         for (i = 0; i < bta_dm_cb.device_list.count; 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
             }
         }
-        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
index cbcce62200e22145b450252a484c978b49f76992..98c0eada90a6a45f1f420b6ff6cc2bcaa303912e 100644 (file)
@@ -1493,7 +1493,7 @@ static void btc_a2dp_source_feeding_state_reset(void)
              btc_aa_src_cb.media_feeding.cfg.pcm.num_channel *
              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);
     }
 }
index 8c8e4dde6d0c7ed4bc8cb00bba179c8309576095..2ba50e41301c7da47c1cf036c096cf02f9d996fc 100644 (file)
@@ -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: {
         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;
     }
     case BTA_DM_DISC_RES_EVT:
-        LOG_ERROR("BTA_DM_DISC_RES_EVT\n");
+        LOG_DEBUG("BTA_DM_DISC_RES_EVT\n");
         break;
     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;
     case BTA_DM_DISC_CMPL_EVT:
-        LOG_ERROR("BTA_DM_DISC_CMPL_EVT\n");
+        LOG_DEBUG("BTA_DM_DISC_CMPL_EVT\n");
         break;
     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;
     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;
     default:
         LOG_ERROR("%s : Unknown event 0x%x\n", __FUNCTION__, event);
index 6a4d51974733ce55cb369f09d73bc3ad387ac7ec..3a66df1985ce52d6b27ac5837826617119440d7c 100644 (file)
@@ -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);
     if (btc_gattc_cb) {
        btc_gattc_cb(event, gattc_if, param);
-    }                                                                  
+    }
 }
 
 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
     switch (msg->act) {
         case BTA_GATTC_READ_DESCR_EVT:
-        case BTA_GATTC_READ_CHAR_EVT: 
+        case BTA_GATTC_READ_CHAR_EVT:
         case BTA_GATTC_READ_MUTIPLE_EVT: {
             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);
@@ -141,7 +141,7 @@ static void btc_gattc_copy_req_data(btc_msg_t *msg, void *p_dest, void *p_src)
                 }
             }
             break;
-        } 
+        }
         default:
             break;
     }
@@ -152,7 +152,7 @@ static void btc_gattc_free_req_data(btc_msg_t *msg)
     tBTA_GATTC *arg = (tBTA_GATTC *)(msg->arg);
     switch (msg->act) {
         case BTA_GATTC_READ_DESCR_EVT:
-        case BTA_GATTC_READ_CHAR_EVT: 
+        case BTA_GATTC_READ_CHAR_EVT:
         case BTA_GATTC_READ_MUTIPLE_EVT: {
             if (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,
                                                            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));
         btc_to_bta_uuid(bta_uuid, svc_uuid);
     }
-    
+
     BTA_GATTC_GetServiceWithUUID(conn_id, bta_uuid, &db, &svc_num);
 
     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) {
             osi_free(bta_uuid);
         }
-        return status; 
+        return status;
     } else {
         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) {
             osi_free(db);
         }
-        return status; 
+        return status;
     } else {
         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 end_handle,
                                                  esp_bt_uuid_t char_uuid,
-                                                 esp_gattc_char_elem_t *result, 
+                                                 esp_gattc_char_elem_t *result,
                                                  uint16_t *count)
 {
     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,
                                                   esp_bt_uuid_t char_uuid,
                                                   esp_bt_uuid_t descr_uuid,
-                                                  esp_gattc_descr_elem_t *result, 
+                                                  esp_gattc_descr_elem_t *result,
                                                   uint16_t *count)
 {
     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};
     btc_to_bta_uuid(&bta_char_uuid, &char_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);
 
     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 {
         btc_gattc_fill_gatt_db_conversion(*count, (uint16_t)descr_num, ESP_GATT_DB_DESCRIPTOR, 0, (void *)result, db);
     }
-    
+
     *count = descr_num;
     //don't forget to free the db buffer after used.
     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;
     tBT_UUID bta_descr_uuid = {0};
     btc_to_bta_uuid(&bta_descr_uuid, &descr_uuid);
-    
+
     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) {
@@ -479,7 +479,7 @@ esp_gatt_status_t btc_ble_gattc_get_descr_by_char_handle(uint16_t conn_id,
         osi_free(db);
     }
     return ESP_GATT_OK;
-    
+
 }
 
 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)
 {
-    BTA_GATTC_WriteCharValue(arg->write_char.conn_id, 
+    BTA_GATTC_WriteCharValue(arg->write_char.conn_id,
                              arg->write_char.handle,
                              arg->write_char.write_type,
                              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.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.write_type, &descr_val,
                              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);
     switch (msg->act) {
     case BTC_GATTC_ACT_APP_REGISTER:
-        LOG_ERROR("%s()", __func__);
         btc_gattc_app_register(arg);
         break;
     case BTC_GATTC_ACT_APP_UNREGISTER:
index c33aa8943aa8522bf1ab3a01d5147d07f75bc272..8895f968e20efec97d30e0899f2817892d98b6c6 100644 (file)
@@ -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)
 {
-    AVCT_TRACE_WARNING("avct_lcb_chk_disc");
+    AVCT_TRACE_EVENT("avct_lcb_chk_disc");
 #if (AVCT_BROWSE_INCLUDED == TRUE)
     avct_close_bcb(p_lcb, p_data);
 #endif
     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;
         avct_lcb_event(p_lcb, AVCT_LCB_INT_CLOSE_EVT, p_data);
     } else {
-        AVCT_TRACE_WARNING("dealloc ccb");
+        AVCT_TRACE_EVENT("dealloc ccb");
         avct_lcb_unbind_disc(p_lcb, p_data);
     }
 }
index bc591ad7240c58deec9dbb5c81e59c4b612a2a56..dda360de23726251191b9102a88f5aa08f564214 100644 (file)
@@ -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)
 {
     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 */
     if (!controller_get_interface()->get_is_ready()) {
         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_TRACE_ERROR ("%s\n", __func__);
     /* Commenting out trace due to obf/compilation problems.
     */
 #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) {
                     (*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);
             }
         }
index 059ad6364a5cd10360286f7e3982936c90cfce1a..04a6ec7948bf2af8c3ac05de175d403bc67fadde 100644 (file)
@@ -656,7 +656,7 @@ static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
     /*******************************************************************/
 
 #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);
 #endif
 
index 289c1f160de60e9b9921ae138bdc07d6692beec4..b1c432c576d884ea4b832db8f3acf20687a6572e 100644 (file)
@@ -123,7 +123,7 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
                 sample_rate = 48000;
             }
             i2s_set_clk(0, sample_rate, 16, 2);
-        
+
             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[1],
index bd4529d20284e125a6eb7cf5249a0228f82c48fc..e6dd46f633180f945377b0598beab0ef3801ba82 100644 (file)
@@ -320,7 +320,7 @@ static void a2d_app_heart_beat(void *arg)
 
 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) {
     case APP_AV_STATE_DISCOVERING:
     case APP_AV_STATE_DISCOVERED:
index 7597ffb2e713d72b0700c04e50c515871bc12714..1071512d824ecfd22aaff94f2a00034a9fc48c0a 100644 (file)
@@ -307,7 +307,7 @@ static void gattc_profile_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
 
     switch (event) {
     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);
         break;
     case ESP_GATTC_CONNECT_EVT:
index 50c8190821ac4e739078e734777089302def1f93..f81ebadc4097a940b18e525ea171300850de7714 100644 (file)
@@ -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)
 {
-    ESP_LOGE(GATTS_TABLE_TAG, "GAP_EVT, event %d\n", event);
+    ESP_LOGI(GATTS_TABLE_TAG, "GAP_EVT, event %d\n", event);
 
     switch (event) {
     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;
     uint8_t res = 0xff;
 
-    ESP_LOGE(GATTS_TABLE_TAG, "event = %x\n",event);
+    ESP_LOGI(GATTS_TABLE_TAG, "event = %x\n",event);
     switch (event) {
        case ESP_GATTS_REG_EVT:
            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;
         }
     }
-       
+
     do {
         int idx;
         for (idx = 0; idx < SPP_PROFILE_NUM; idx++) {
index ee0ee41707d4e368ae3ffe3bcbac3f0397653691..65b29c239f0780d0817a11a479cd552ad28b1bf1 100644 (file)
@@ -361,7 +361,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
         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.
         ///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;
     case ESP_GAP_BLE_KEY_EVT:
         //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));
     /* 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;
-    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. */
     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));
index 952b0dc7dd7f6eae2b9aafd487949f0b30ae3fdc..39762eccc34dd7719c70d192e5c3de70f48230ee 100644 (file)
@@ -40,7 +40,7 @@ uint8_t heart_str[] = {0x11,0x22,0x33};
 
 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_len     = sizeof(heart_str),
@@ -101,7 +101,7 @@ struct gatts_profile_inst {
     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);
 
 /* 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] =
 {
     // 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,
       sizeof(uint16_t), sizeof(heart_rate_svc), (uint8_t *)&heart_rate_svc}},
 
     // 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,
       CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_notify}},
-      
+
     // 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,
       HRPS_HT_MEAS_MAX_LEN,0, NULL}},
 
     // 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,
       sizeof(uint16_t),sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
 
     // 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,
       CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read}},
 
     // 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,
       sizeof(uint8_t), sizeof(body_sensor_loc_val), (uint8_t *)body_sensor_loc_val}},
 
     // 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,
       CHAR_DECLARATION_SIZE,CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write}},
-                                                               
+
     // 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,
-      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)
@@ -304,7 +304,7 @@ static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param
         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.
         ///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;
     case ESP_GAP_BLE_KEY_EVT:
         //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;
         case ESP_GATTS_READ_EVT:
             break;
-        case ESP_GATTS_WRITE_EVT: 
+        case ESP_GATTS_WRITE_EVT:
             ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_WRITE_EVT, write value:");
             esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
             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)
 {
     /* 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;
         } else {
             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);
             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));
     /* 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;
-    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. */
     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));
 
-    /* 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
-     * 
+     *
      * vTaskDelay(30000 / portTICK_PERIOD_MS);
      * remove_all_bonded_devices();
      */
index 7467da7cc2e0c41cd849a4ee05ba02c3b8c924c5..8cd1bef67b975c8b6521e5817efacdf37ba875f8 100644 (file)
@@ -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:
         //scan start complete event to indicate scan start successfully or failed
         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{
             ESP_LOGE(GATTC_TAG, "Scan start failed");
         }