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

Fixed Undefined Reference Error by Changing Value of BTM_OOB_INCLUDED Macro #2206

Closed
wants to merge 1 commit into from

Conversation

Noble-Mushtak
Copy link
Contributor

I have tried to build the a2dp_sink project from the examples, where the Hands Free/Handset Profile is enabled in make menuconfig. The resulting sdkconfig file that came out of this configuration can be looked at here. However, when I try to build the project, I get the following error:

LD build/a2dp_sink.elf
$BUILD_DIR_BASE/bt/libbt.a(btm_sco.o):(.literal.btm_send_connect_request+0x14): undefined reference to `BTM_BothEndsSupportSecureConnections'
$BUILD_DIR_BASE/bt/libbt.a(btm_sco.o): In function `btm_send_connect_request':
$IDF_PATH/components/bt/bluedroid/stack/btm/btm_sco.c:1642: undefined reference to `BTM_BothEndsSupportSecureConnections'
collect2: error: ld returned 1 exit status
make: *** [$BUILD_DIR_BASE/a2dp_sink.elf] Error 1

This error occurs because BTM_BothEndsSupportSecureConnections is not being included in the preprocessor output of btm_sec.c, so this symbol is never defined. It is not included in the preprocessor output because of the following #if directive from line 1601 of btm_sec.c:

#if BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE

This #if evaluates to false because BTM_OOB_INCLUDED is defined as FALSE on lines 736-739 of bt_target.h:

/* Include Out-of-Band implementation for Simple Pairing */
#ifndef BTM_OOB_INCLUDED
#define BTM_OOB_INCLUDED                FALSE//TRUE
#endif

Changing line 738 to #define BTM_OOB_INCLUDED TRUE fixes the error above and allows me to build the a2dp_sink.elf file successfully. Therefore, I have made this pull request with that change in order to fix this bug. Perhaps there is a better way to fix this if BTM_OOB_INCLUDED is supposed to be defined in some other file, but this is the only way I could figure out how to fix the issue.

@CLAassistant
Copy link

CLAassistant commented Jul 19, 2018

CLA assistant check
All committers have signed the CLA.

@igrr igrr requested a review from blueMoodBHD July 23, 2018 21:46
@blueMoodBHD
Copy link
Collaborator

@Noble-Mushtak There is no problem in the pull request, Thanks very much for your help.
@igrr I have reviewed the change and done some tests. There is no problem in Secure Simple Pairing. I think we can merge this pull request.

@igrr igrr added the Status: Pending blocked by some other factor label Jul 30, 2018
igrr pushed a commit that referenced this pull request Aug 6, 2018
@projectgus
Copy link
Contributor

Cherry-picked as dbd429a, thanks!

@projectgus projectgus closed this Aug 6, 2018
@igrr igrr removed the Status: Pending blocked by some other factor label Aug 9, 2018
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this pull request Jun 28, 2019
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

5 participants