How to modify Legato so i can use #include <bluetooth/bluetooth.h>
Using WP7702, Legato 21.05.0
I also need
glib.h
hci.h
and other stuff to make a bluetooth gatt app
I have a modified yocto so wifi/bluetooth is enable and working from terminal
How to modify Legato so i can use #include <bluetooth/bluetooth.h>
Using WP7702, Legato 21.05.0
I also need
glib.h
hci.h
and other stuff to make a bluetooth gatt app
I have a modified yocto so wifi/bluetooth is enable and working from terminal
do you find those .h in WP7702 toolchain or legato framework?
I see them in the .leaf directory but not in the workspace
/home/pm/.leaf/wp77-toolchain_SWI9X06Y_03.00.13.00-linux64/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/net/bluetooth/bluetooth.h
I have tried to add the following in legato application:
#include <net/bluetooth/bluetooth.h>
And then add the include path in cdef:
cflags:
{
-I/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/
}
It can find the bluetooth.h, but it has other error that you might need to look into:
[1/7] Compiling C source
FAILED: /home/owner/leaf/_build_hello1/wp76xx/component/598dddf46183d3f61a6b0e59694657dd/obj/2bd5bc6171ca6194a354439b219fcab2.o
/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi -MMD -MF /home/owner/leaf/_build_hello1/wp76xx/component/598dddf46183d3f61a6b0e59694657dd/obj/2bd5bc6171ca6194a354439b219fcab2.o.d -Wall -Werror -fvisibility=hidden -c /home/owner/leaf/apps/Demo/hello1/hello1Component/hello1Component.c -o /home/owner/leaf/_build_hello1/wp76xx/component/598dddf46183d3f61a6b0e59694657dd/obj/2bd5bc6171ca6194a354439b219fcab2.o -DLE_FILENAME=`basename /home/owner/leaf/apps/Demo/hello1/hello1Component/hello1Component.c` -DMK_TOOLS_BUILD -DLEGATO_EMBEDDED -fPIC -I /home/owner/leaf/_build_hello1/wp76xx -I/home/owner/leaf/leaf-data/wp76/wp76-legato/interfaces -I/home/owner/leaf/leaf-data/wp76/wp76-legato/framework/include -I/home/owner/leaf/leaf-data/wp76/wp76-legato/build/wp76xx/framework/include -I/home/owner/leaf/apps/Demo/hello1 -I/home/owner/leaf/_build_hello1/wp76xx/component/598dddf46183d3f61a6b0e59694657dd/src -DLE_COMPONENT_NAME=hello1Component -DLE_LOG_SESSION=hello1Component_LogSession -DLE_LOG_LEVEL_FILTER_PTR=hello1Component_LogLevelFilterPtr -I/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/
In file included from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/asm/poll.h:1:0,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/linux/poll.h:1,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/net/bluetooth/bluetooth.h:29,
from /home/owner/leaf/apps/Demo/hello1/hello1Component/hello1Component.c:5:
/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/asm-generic/poll.h:5:0: error: "POLLIN" redefined [-Werror]
#define POLLIN 0x0001
In file included from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/sys/poll.h:25:0,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/poll.h:1,
from /home/owner/leaf/leaf-data/wp76/wp76-legato/framework/include/linux/legato.h:22,
from /home/owner/leaf/leaf-data/wp76/wp76-legato/framework/include/legato.h:157,
from /home/owner/leaf/apps/Demo/hello1/hello1Component/hello1Component.c:2:
/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/bits/poll.h:25:0: note: this is the location of the previous definition
#define POLLIN 0x001 /* There is data to read. */
In file included from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/asm/poll.h:1:0,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/linux/poll.h:1,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/net/bluetooth/bluetooth.h:29,
from /home/owner/leaf/apps/Demo/hello1/hello1Component/hello1Component.c:5:
/home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel/usr/include/asm-generic/poll.h:6:0: error: "POLLPRI" redefined [-Werror]
#define POLLPRI 0x0002
In file included from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/sys/poll.h:25:0,
from /home/owner/leaf/leaf-data/wp76/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueaThe terminal process "/bin/bash '-c', 'mkapp ${LEGATO_DEF_FILE} -s components -t ${LEGATO_TARGET}'" terminated with exit code: 1.
BTW, I suggest you cross compile your native-c application with the WP77 toolchain first.
I get the same!
I feel like the wp77-toolchain need to be recompiled somehow with bluetooth and other libs?
I am building a component in VS Code with the rest of our application
I am wondering if you should build your application inside yocto source instead of toolchain