Skip to content

Commit 05fdc51

Browse files
committed
Rename "TAG" to "LOG_TAG" to avoid conflict with Arduino core.
Fixes #670
1 parent 4c295cd commit 05fdc51

File tree

5 files changed

+60
-59
lines changed

5 files changed

+60
-59
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
1212
- `NimBLEEddystoneTLM` now correctly sets/gets negative temperatures.
1313
- Adding to the whitelist will now allow the device to be added again if the previous attempts failed.
1414
- The IPC calls added to esp_nimble_hci have been removed to prevent IPC stack crashing.
15+
- Espressif log tag renamed from "TAG" to "LOG_TAG" to avoid conflict with Arduino core definition.
1516

1617
### Added
1718
- `NimBLEAdvertisedDevice` new method: `getAdvFlags`, to read the flags advertised.

src/nimble/esp_port/esp-hci/include/esp_nimble_hci.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ esp_err_t esp_nimble_hci_init(void);
5353
*
5454
* int ret = esp_nimble_hci_and_controller_init();
5555
* if (ret != ESP_OK) {
56-
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_init() failed with error: %d", ret);
56+
ESP_LOGE(LOG_TAG, "esp_nimble_hci_and_controller_init() failed with error: %d", ret);
5757
* return;
5858
* }
5959
*
@@ -103,7 +103,7 @@ esp_err_t esp_nimble_hci_deinit(void);
103103
*
104104
* ret = esp_nimble_hci_and_controller_deinit();
105105
* if (ret != ESP_OK) {
106-
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
106+
ESP_LOGE(LOG_TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
107107
* }
108108
* }
109109
* @endcode

src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static struct os_mempool ble_hci_evt_lo_pool;
5151
static os_membuf_t *ble_hci_evt_lo_buf;
5252

5353
static SemaphoreHandle_t vhci_send_sem;
54-
const static char *TAG = "NimBLE";
54+
const static char *LOG_TAG = "NimBLE";
5555

5656
int os_msys_buf_alloc(void);
5757
void os_msys_buf_free(void);
@@ -77,7 +77,7 @@ int ble_hci_trans_hs_cmd_tx(uint8_t *cmd)
7777
*cmd = BLE_HCI_UART_H4_CMD;
7878
len = BLE_HCI_CMD_HDR_LEN + cmd[3] + 1;
7979
if (!esp_vhci_host_check_send_available()) {
80-
ESP_LOGD(TAG, "Controller not ready to receive packets");
80+
ESP_LOGD(LOG_TAG, "Controller not ready to receive packets");
8181
}
8282

8383
if (xSemaphoreTake(vhci_send_sem, NIMBLE_VHCI_TIMEOUT_MS / portTICK_PERIOD_MS) == pdTRUE) {
@@ -113,7 +113,7 @@ int ble_hci_trans_hs_acl_tx(struct os_mbuf *om)
113113
}
114114

115115
if (!esp_vhci_host_check_send_available()) {
116-
ESP_LOGD(TAG, "Controller not ready to receive packets");
116+
ESP_LOGD(LOG_TAG, "Controller not ready to receive packets");
117117
}
118118

119119
len = 1 + OS_MBUF_PKTLEN(om);
@@ -249,11 +249,11 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
249249
m = ble_hci_trans_acl_buf_alloc();
250250

251251
if (!m) {
252-
ESP_LOGE(TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__);
252+
ESP_LOGE(LOG_TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__);
253253
return;
254254
}
255255
if ((rc = os_mbuf_append(m, data, len)) != 0) {
256-
ESP_LOGE(TAG, "%s failed to os_mbuf_append; rc = %d", __func__, rc);
256+
ESP_LOGE(LOG_TAG, "%s failed to os_mbuf_append; rc = %d", __func__, rc);
257257
os_mbuf_free_chain(m);
258258
return;
259259
}
@@ -338,7 +338,7 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
338338
assert(totlen <= UINT8_MAX + BLE_HCI_EVENT_HDR_LEN);
339339

340340
if (totlen > MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)) {
341-
ESP_LOGE(TAG, "Received HCI data length at host (%d) exceeds maximum configured HCI event buffer size (%d).",
341+
ESP_LOGE(LOG_TAG, "Received HCI data length at host (%d) exceeds maximum configured HCI event buffer size (%d).",
342342
totlen, MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE));
343343
ble_hs_sched_reset(BLE_HS_ECONTROLLER);
344344
return 0;

0 commit comments

Comments
 (0)