2020-05-25 12:07 PM
I can access it with the given tools, like bluetoothctl, but I cannot build that same tool, so that I can write my own code. It seems some header files or libraries are missed. Am I missing something?
2020-05-25 02:57 PM
Check to see if your local.conf contains the following, don't think all of the bluetooth modules are included by default.
DISTRO_FEATURES_append += "bluetooth"
DISTRO_FEATURES_append += "bluez5"
2020-05-25 03:47 PM
Thanks for the reply. The local.conf in the distribution package does not have the lines you mentioned, although the STM32... kit does use bluetooth. For example, when I use the bluetoothctl tool I can access and work with the bluetooth. However, I want to use some of the source code for the bluetoothctl but I cannot build. (Also, when I tried to build the kernel from the distribution package, the build was unsuccessful, although I followed all the prescribed steps.) If I want to access the bluetooth module directly, I know linux uses the UART2, but how to access it through linux? The /dev/xxxx does not show me anything relevant.
2020-05-25 04:23 PM
I ran into similar issues, I could run some pre-built demos, however, I could not build my own code against any libraries.
First check if you have the following in your sdk
YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/bluetooth/... (Directory of bluetooth include files)
YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/libbluetooth.so (bluetooth library)
If these are missing, you'll need to rebuild the image and sdk with changes I mentioned.
2020-05-25 05:09 PM
I have the libbluetooth.so but not in the place you suggested but under the /build-openstlinuxweston-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/bluez5/usr/lib/. Same with the include/blue...., it is under the .../bluez5/usr/. I will try to rebuild it.
2020-05-25 05:35 PM
I'm sorry, I sent you the elgfs distribution, you're on weston
If you have these, you should be good to go.
YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/usr/include/bluetooth/... (Directory of bluetooth include files)
YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/usr/lib/libbluetooth.so (bluetooth library)
Only other suggestion is to make sure you are putting bluetooth/ prefix on your include files
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
2020-05-26 11:06 AM
Well, I tried to build some of the tools. I managed to do so for the hciconfig and hciattach, but not for the gatt-service. There seems to be some missing files, related to glib, dbus, etc.
2020-05-27 03:16 PM
Well, after quite some exhausting search, I managed to build some other tools, like btgatt-client, btgatt-server and gatttool. Now I need to test them with two kits.