Skip to content

Commit

Permalink
Rename "TAG" to "LOG_TAG" to avoid conflict with Arduino core.
Browse files Browse the repository at this point in the history
Fixes #670
  • Loading branch information
h2zero committed Jun 13, 2024
1 parent a75de3d commit 068419d
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 59 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- `NimBLEEddystoneTLM` now correctly sets/gets negative temperatures.
- Adding to the whitelist will now allow the device to be added again if the previous attempts failed.
- The IPC calls added to esp_nimble_hci have been removed to prevent IPC stack crashing.
- Espressif log tag renamed from "TAG" to "LOG_TAG" to avoid conflict with Arduino core definition.

### Added
- `NimBLEAdvertisedDevice` new method: `getAdvFlags`, to read the flags advertised.
Expand Down
4 changes: 2 additions & 2 deletions src/nimble/esp_port/esp-hci/include/esp_nimble_hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ esp_err_t esp_nimble_hci_init(void);
*
* int ret = esp_nimble_hci_and_controller_init();
* if (ret != ESP_OK) {
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_init() failed with error: %d", ret);
ESP_LOGE(LOG_TAG, "esp_nimble_hci_and_controller_init() failed with error: %d", ret);
* return;
* }
*
Expand Down Expand Up @@ -103,7 +103,7 @@ esp_err_t esp_nimble_hci_deinit(void);
*
* ret = esp_nimble_hci_and_controller_deinit();
* if (ret != ESP_OK) {
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
ESP_LOGE(LOG_TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
* }
* }
* @endcode
Expand Down
12 changes: 6 additions & 6 deletions src/nimble/esp_port/esp-hci/src/esp_nimble_hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static struct os_mempool ble_hci_evt_lo_pool;
static os_membuf_t *ble_hci_evt_lo_buf;

static SemaphoreHandle_t vhci_send_sem;
const static char *TAG = "NimBLE";
const static char *LOG_TAG = "NimBLE";

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

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

if (!esp_vhci_host_check_send_available()) {
ESP_LOGD(TAG, "Controller not ready to receive packets");
ESP_LOGD(LOG_TAG, "Controller not ready to receive packets");
}

len = 1 + OS_MBUF_PKTLEN(om);
Expand Down Expand Up @@ -249,11 +249,11 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
m = ble_hci_trans_acl_buf_alloc();

if (!m) {
ESP_LOGE(TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__);
ESP_LOGE(LOG_TAG, "%s failed to allocate ACL buffers; increase ACL_BUF_COUNT", __func__);
return;
}
if ((rc = os_mbuf_append(m, data, len)) != 0) {
ESP_LOGE(TAG, "%s failed to os_mbuf_append; rc = %d", __func__, rc);
ESP_LOGE(LOG_TAG, "%s failed to os_mbuf_append; rc = %d", __func__, rc);
os_mbuf_free_chain(m);
return;
}
Expand Down Expand Up @@ -338,7 +338,7 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
assert(totlen <= UINT8_MAX + BLE_HCI_EVENT_HDR_LEN);

if (totlen > MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)) {
ESP_LOGE(TAG, "Received HCI data length at host (%d) exceeds maximum configured HCI event buffer size (%d).",
ESP_LOGE(LOG_TAG, "Received HCI data length at host (%d) exceeds maximum configured HCI event buffer size (%d).",
totlen, MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE));
ble_hs_sched_reset(BLE_HS_ECONTROLLER);
return 0;
Expand Down
Loading

0 comments on commit 068419d

Please sign in to comment.