Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue_3209. #3210

Merged
merged 3 commits into from
Oct 1, 2019
Merged

Conversation

william-ferguson-au
Copy link
Contributor

#include "esp32-hal-log.h" is mandatory is order to build BLEDevice.cpp.
It can't be left up to a compiler variable.

#include "esp32-hal-log.h" is mandatory is order to build BLEDevice.cpp.
It can't be left up to a compiler variable.
@me-no-dev
Copy link
Member

leftovers from when this library was hosted elsewhere :) it was used so it can compile in IDF without Arduino. Just removing it can cause other issues, like if you use Arduino as IDF component and have not selected to forward IDF errors to Arduino's logging. Then you will get compile error for undefined ESP_LOGx

@william-ferguson-au
Copy link
Contributor Author

So what's the solution then?

@me-no-dev
Copy link
Member

do as you have done for all files in the library and change ESP_LOGx(TAG, to log_x(

@me-no-dev
Copy link
Member

that will force the library to use Arduino's logging and since it's a part of it, that is fine :)

@william-ferguson-au
Copy link
Contributor Author

Sorry, that seems backward to me.
The other arduino-esp32 libraries all use ESP_LOGx(Tag,

Isn't the aim of the arduino-esp32 libraries to provide components usable in an Arduino context that map to esp32 APIs?

@me-no-dev
Copy link
Member

what arduino libraries use ESP_LOGx(Tag, ? arduino libs use log_x(

@me-no-dev
Copy link
Member

ESP_LOGx is IDF API that is not controllable through the Arduino IDE and API. Once included IDF libs are precompiled, that is what it is for them. Therefore Arduino uses log_x as logging API and that is controllable through the IDE.

@william-ferguson-au
Copy link
Contributor Author

My mistake.

@william-ferguson-au
Copy link
Contributor Author

OK, reopening because I believe I was correct and have run into this again trying to upgrade from 1.0.3 to master. Our conversation became derailed at this comment #3210 (comment).

BLEDevice.cpp is failing to compile because it can't find the log_x() functions.

It can't find them because they are declared in esp32-hal-log.h and unlike all the other BLE sources which always include esp32-hal-log.h, BLEDevice.cpp only includes esp32-hal-log.h when the compiler var CONFIG_ARDUHAL_ESP_LOG is defined.

BLEDevice.spp should always include esp32-hal-log.h instead of omitting it if CONFIG_ARDUHAL_ESP_LOG is not defined.

@me-no-dev
Copy link
Member

so... you made one change to one file, because you had issues with that file. I asked you to make the same change to all files and to replace any occurrence of ESP_LOGx with log_x. If you are not willing to do it, just say so and I'll do the whole thing myself. As-is, I will not merge just that change.

@william-ferguson-au
Copy link
Contributor Author

william-ferguson-au commented Oct 1, 2019

Sorry, there seems to be some confusion here.
I changed BLEDevice.cpp because it was the only BLE file whose includes had not been changed when Bascy refactored all the BLE files to switch from ESP_LOGX to log_x (16-APR-2019).

As far as I am aware there aren't any arduino-esp32 files that are using ESP_LOGX.
So the only change that needs to be made is the one that I have changed.

@me-no-dev
Copy link
Member

yup confusion :)

@me-no-dev me-no-dev merged commit 8a46697 into espressif:master Oct 1, 2019
@william-ferguson-au william-ferguson-au deleted the issue_3209 branch March 27, 2021 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants