]> granicus.if.org Git - esp-idf/commitdiff
bt component: optimize gatt debug information
authorisland <island@espressif.com>
Tue, 7 Mar 2017 11:55:21 +0000 (19:55 +0800)
committerisland <island@espressif.com>
Tue, 7 Mar 2017 11:55:21 +0000 (19:55 +0800)
components/bt/bluedroid/api/esp_gatts_api.c
components/bt/bluedroid/stack/gatt/gatt_db.c
components/bt/bluedroid/stack/gatt/gatt_sr.c

index 3a31d7959bd8763cee898c450337319c0b6a8d53..3e5d8f581570c36b902ca1beeb400c283b79c249 100644 (file)
@@ -158,8 +158,8 @@ esp_err_t esp_ble_gatts_add_char(uint16_t service_handle,  esp_bt_uuid_t  *char_
 
     if (char_val != NULL){
         if (char_val->attr_len > char_val->attr_max_len){
-            LOG_ERROR("Error in %s, line=%d,attribute actual length should not be larger than max length\n",\
-                            __func__, __LINE__);
+            LOG_ERROR("Error in %s, line=%d,attribute actual length (%d)  should not be larger than max length (%d)\n",\
+                            __func__, __LINE__, char_val->attr_len, char_val->attr_max_len);
             return ESP_ERR_INVALID_ARG;
         }
     }
@@ -214,8 +214,8 @@ esp_err_t esp_ble_gatts_add_char_descr (uint16_t service_handle,
 
     if (char_descr_val != NULL){
         if (char_descr_val->attr_len > char_descr_val->attr_max_len){
-            LOG_ERROR("Error in %s, line=%d,attribute actual length should not be larger than max length\n",\
-                            __func__, __LINE__);
+            LOG_ERROR("Error in %s, line=%d,attribute actual length (%d) should not be larger than max length (%d)\n",\
+                            __func__, __LINE__, char_descr_val->attr_len, char_descr_val->attr_max_len);
             return ESP_ERR_INVALID_ARG;
         }
     }
index 60749a0f47a5a5c784cbcc6248c35e839998c9c9..3f9066d05d635d8dfc042f08683cdc9ebfa3183f 100644 (file)
@@ -528,7 +528,7 @@ UINT16 gatts_add_characteristic (tGATT_SVC_DB *p_db, tGATT_PERM perm,
             if (p_char_val->p_value->attr_val.attr_val == NULL) {
                deallocate_attr_in_db(p_db, p_char_decl);
                deallocate_attr_in_db(p_db, p_char_val);
-               GATT_TRACE_ERROR("Warning in %s, line=%d, insufficient resource to allocate for attribute value\n", __func__, __LINE__);
+               GATT_TRACE_WARNING("Warning in %s, line=%d, insufficient resource to allocate for attribute value\n", __func__, __LINE__);
                return 0;
             }
             
@@ -536,7 +536,7 @@ UINT16 gatts_add_characteristic (tGATT_SVC_DB *p_db, tGATT_PERM perm,
             memset(p_char_val->p_value->attr_val.attr_val, 0, attr_val->attr_max_len);
             if (attr_val->attr_val != NULL) {
                 if (attr_val->attr_max_len < attr_val->attr_len){
-                    GATT_TRACE_ERROR("Error in %s, Line=%d, attribute actual length(%d) should not larger than max size(%d)\n",
+                    GATT_TRACE_ERROR("Error in %s, Line=%d, attribute actual length (%d) should not larger than max size (%d)\n",
                                     __func__, __LINE__, attr_val->attr_len, attr_val->attr_max_len);
                 }
                 UINT16 actual_len = (attr_val->attr_max_len < attr_val->attr_len) ? (attr_val->attr_max_len) : (attr_val->attr_len);
@@ -638,8 +638,8 @@ UINT16 gatts_add_char_descr (tGATT_SVC_DB *p_db, tGATT_PERM perm,
 
     if (attr_val != NULL){
         if (attr_val->attr_len > attr_val->attr_max_len){
-            GATT_TRACE_ERROR("Error in %s, line=%d,attribute actual length should not be larger than max length\n",\
-                    __func__, __LINE__);
+            GATT_TRACE_ERROR("Error in %s, line=%d,attribute actual length (%d) should not be larger than max length (%d)\n",\
+                    __func__, __LINE__, attr_val->attr_len, attr_val->attr_max_len);
             return 0;
         }
     }
@@ -664,7 +664,7 @@ UINT16 gatts_add_char_descr (tGATT_SVC_DB *p_db, tGATT_PERM perm,
                 p_char_dscptr->p_value->attr_val.attr_val = GKI_getbuf(attr_val->attr_max_len);
                 if (p_char_dscptr->p_value->attr_val.attr_val == NULL) {
                     deallocate_attr_in_db(p_db, p_char_dscptr);
-                    GATT_TRACE_ERROR("Warning in %s, line=%d, insufficient resource to allocate for descriptor value\n", __func__, __LINE__);
+                    GATT_TRACE_WARNING("Warning in %s, line=%d, insufficient resource to allocate for descriptor value\n", __func__, __LINE__);
                     return 0;
                 }
 
index 317eaaca7a03bb8f4c0aa9969cf85f740fe45b6d..4afcab794e5b8093fd1ea85895d893a61ba8d36c 100644 (file)
@@ -387,8 +387,8 @@ void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U
         is_prepare_write_valid = TRUE;
     }
     else if(prepare_record->total_num < queue_num) {
-        GATT_TRACE_ERROR("Error in %s, line=%d, prepare write total number(=%d) \
-                        should not smaller than prepare queue number(=%d)\n", \
+        GATT_TRACE_ERROR("Error in %s, line=%d, prepare write total number (%d) \
+                        should not smaller than prepare queue number (%d)\n", \
                         __func__, __LINE__,prepare_record->total_num, queue_num); 
     }
     else if (prepare_record->error_code_app != GATT_SUCCESS){
@@ -1141,8 +1141,6 @@ void gatts_process_write_req (tGATT_TCB *p_tcb, UINT8 i_rcb, UINT16 handle,
             status = GATT_BUSY; /* max pending command, application error */
         }
     }
-    //test isl
-    GATT_TRACE_ERROR("!!!write opcode=0x%x, need_rsp=0x%x, status=0x%x\n",op_code, sr_data.write_req.need_rsp, status); 
 
     /* response should be sent only for write_request */
     if ((op_code == GATT_REQ_WRITE) && (sr_data.write_req.need_rsp == FALSE)){