Dear community,
I need to include in my image generated with YOCTO the bluetooth libraries (bluetooth.h , hci.h
and hci_lib.h) in order to generate a C++ application that interacts with BT devices.
I have tried in many ways and I can’t find the right way. Could someone tell me what changes I need to make in the local.conf or what recipes I need to include to get these libraries on board.
I am using the linux reference image for the BSP 6.3 on the Verdin iMX8MM.
Any suggestions?
Thanks to all of you for your collaboration.
Julián
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
To include the Bluetooth libraries (bluetooth.h
, hci.h
, and hci_lib.h
) in your Yocto image for developing a C++ application, you can follow these steps:
-
Modify
local.conf
:
Add the following line to yourlocal.conf
file to include the BlueZ package, which provides the necessary Bluetooth libraries:IMAGE_INSTALL_append = " bluez"
-
Check for Required Recipes:
Ensure that the BlueZ recipe is available in your Yocto layer. The common recipes for Bluetooth support arebluez
andbluez5
. You can add these to your image by including them in yourlocal.conf
or your image recipe. -
Rebuild Your Image:
After making changes to yourlocal.conf
, run the following command to rebuild your image:bitbake <your-image-name>
Replace
<your-image-name>
with the actual name of your reference image.
Make sure your Yocto environment is set up correctly and that you have the necessary layers included in your bblayers.conf
. Also, verify that your BSP (Board Support Package) supports the BlueZ package. After rebuilding, check the output files to ensure the libraries are included in the generated image.
Please, also check if these links can help you solve your problem:
Dear @ToradexAI ,
I have added bluez to my local.conf but it dosen’t work.
Any suggestions?
Julián
Hello @jbruno,
I apologize for the delay on this topic.
To ensure the bluetooth.h
, hci.h
, and hci_lib.h
headers are available, you need to add the following to your local.conf
file:
IMAGE_INSTALL:append = " bluez5"
Then, you can generate an sdk containing these headers with:
bitbake <image> -c populate_sdk
After installing the SDK, the headers will be available in its folder:
ls ./sysroots/cortexa53-tdx-linux/usr/include/bluetooth
bluetooth.h bnep.h cmtp.h hci.h hci_lib.h hidp.h l2cap.h rfcomm.h sco.h sdp.h sdp_lib.h
Best Regards,
Bruno
Hello @jbruno,
Did the above suggestion have the intended effect?
Or do you need further support with this topic?
Best Regards,
Bruno
Dear @bruno.tx,
Thank you very much for your response. At the moment it seems to be enough to start working on a C program to control some bluetooth devices.
Best regards,
Julián