Skip to content

Commit c2131dd

Browse files
committed
ble_gatts: update log outputs
1 parent f2870a3 commit c2131dd

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

main/src/user/ble_gatts.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
#define BLE_GATTS_TAG "ble_gatts"
2525

26+
#define GATTS_VFX_TAG "gatts_vfx"
27+
#define GATTS_VER_TAG "gatts_ver"
28+
2629
#define GATTS_SRV_UUID_VFX 0x00AA
2730
#define GATTS_CHAR_UUID_VFX 0xAA01
2831
#define GATTS_DESC_UUID_VFX 0xDEAD
@@ -214,12 +217,12 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
214217
#endif
215218
#endif
216219
} else {
217-
ESP_LOGE(BLE_GATTS_TAG, "command 0x%02X error", param->write.value[0]);
220+
ESP_LOGE(GATTS_VFX_TAG, "command 0x%02X error", param->write.value[0]);
218221
}
219222
break;
220223
}
221224
default:
222-
ESP_LOGW(BLE_GATTS_TAG, "unknown command: 0x%02X", param->write.value[0]);
225+
ESP_LOGW(GATTS_VFX_TAG, "unknown command: 0x%02X", param->write.value[0]);
223226
break;
224227
}
225228
}
@@ -249,7 +252,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
249252
NULL,
250253
NULL);
251254
if (add_char_ret) {
252-
ESP_LOGE(BLE_GATTS_TAG, "add char failed, error code =%x", add_char_ret);
255+
ESP_LOGE(GATTS_VFX_TAG, "add char failed, error code =%x", add_char_ret);
253256
}
254257
break;
255258
case ESP_GATTS_ADD_INCL_SRVC_EVT:
@@ -265,7 +268,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
265268
NULL,
266269
NULL);
267270
if (add_descr_ret) {
268-
ESP_LOGE(BLE_GATTS_TAG, "add char descr failed, error code =%x", add_descr_ret);
271+
ESP_LOGE(GATTS_VFX_TAG, "add char descr failed, error code =%x", add_descr_ret);
269272
}
270273
break;
271274
case ESP_GATTS_ADD_CHAR_DESCR_EVT:
@@ -281,7 +284,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
281284
xEventGroupClearBits(user_event_group, BLE_GATTS_IDLE_BIT);
282285

283286
uint8_t *bda = param->connect.remote_bda;
284-
ESP_LOGI(BLE_GATTS_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
287+
ESP_LOGI(GATTS_VFX_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
285288
s_gatts_conn_state_str[1], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
286289

287290
gatts_profile_tbl[PROFILE_IDX_VFX].conn_id = param->connect.conn_id;
@@ -290,7 +293,7 @@ static void profile_vfx_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
290293
}
291294
case ESP_GATTS_DISCONNECT_EVT: {
292295
uint8_t *bda = param->connect.remote_bda;
293-
ESP_LOGI(BLE_GATTS_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
296+
ESP_LOGI(GATTS_VFX_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
294297
s_gatts_conn_state_str[0], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
295298

296299
EventBits_t uxBits = xEventGroupGetBits(user_event_group);
@@ -360,7 +363,7 @@ static void profile_ver_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
360363
NULL,
361364
NULL);
362365
if (add_char_ret) {
363-
ESP_LOGE(BLE_GATTS_TAG, "add char failed, error code =%x", add_char_ret);
366+
ESP_LOGE(GATTS_VER_TAG, "add char failed, error code =%x", add_char_ret);
364367
}
365368
break;
366369
case ESP_GATTS_ADD_INCL_SRVC_EVT:
@@ -376,7 +379,7 @@ static void profile_ver_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
376379
NULL,
377380
NULL);
378381
if (add_descr_ret) {
379-
ESP_LOGE(BLE_GATTS_TAG, "add char descr failed, error code =%x", add_descr_ret);
382+
ESP_LOGE(GATTS_VER_TAG, "add char descr failed, error code =%x", add_descr_ret);
380383
}
381384
break;
382385
case ESP_GATTS_ADD_CHAR_DESCR_EVT:
@@ -390,7 +393,7 @@ static void profile_ver_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
390393
break;
391394
case ESP_GATTS_CONNECT_EVT: {
392395
uint8_t *bda = param->connect.remote_bda;
393-
ESP_LOGI(BLE_GATTS_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
396+
ESP_LOGI(GATTS_VER_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
394397
s_gatts_conn_state_str[1], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
395398

396399
gatts_profile_tbl[PROFILE_IDX_VER].conn_id = param->connect.conn_id;
@@ -399,7 +402,7 @@ static void profile_ver_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
399402
}
400403
case ESP_GATTS_DISCONNECT_EVT: {
401404
uint8_t *bda = param->connect.remote_bda;
402-
ESP_LOGI(BLE_GATTS_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
405+
ESP_LOGI(GATTS_VER_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
403406
s_gatts_conn_state_str[0], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
404407
break;
405408
}
@@ -421,7 +424,7 @@ void ble_gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,
421424
if (param->reg.status == ESP_GATT_OK) {
422425
gatts_profile_tbl[param->reg.app_id].gatts_if = gatts_if;
423426
} else {
424-
ESP_LOGI(BLE_GATTS_TAG, "reg app failed, app_id %04x, status %d",
427+
ESP_LOGE(BLE_GATTS_TAG, "reg app failed, app_id %04x, status %d",
425428
param->reg.app_id,
426429
param->reg.status);
427430
return;

0 commit comments

Comments
 (0)