How to import header files in the zephyr\subsys\bluetooth\mesh\shell path in a project

zephyr\subsys\bluetooth\mesh

zephyr\subsys\bluetooth\mesh\shell

I need to use APIs for certain files in the path mentioned above. Currently, I can only copy the files I need to use to the project folder in order to import and call them. Can I directly call the source files in NCS by modifying cmake or other methods, without having to copy these files to the project folder every time?

Parents
  • You should not be needing to copy library files into your project, instead you should just include them in your prj.conf.

    For example, if you need shell extension in your project, you just need to add the below in your prj.conf and all the files are imported into your project to compile. You still need to add the header files in the files where you use the shell API.like #include <zephyr/bluetooth/mesh/shell.h>

    In prj.conf, you just add

    CONFIG_BT_MESH_SHELL=y

  • Actually, I encountered this problem in order to implement the Bluetooth mesh dfu function. Since the Bluetooth mesh dfu in NCS can only be completed through shell commands, I now need to write the APIs actually used in these shell commands into my project, so I need to add some header files in this path. I don't quite understand why NCS only provides the use of shell commands to complete Bluetooth mesh DFU, which is very unfriendly for developing Bluetooth mesh projects.

    I have completed the basic functions of Bluetooth mesh dfu and successfully tested it, but currently I need to copy all the files used to the project, which is too troublesome because ncs already has these files and I don't need to modify them

Reply
  • Actually, I encountered this problem in order to implement the Bluetooth mesh dfu function. Since the Bluetooth mesh dfu in NCS can only be completed through shell commands, I now need to write the APIs actually used in these shell commands into my project, so I need to add some header files in this path. I don't quite understand why NCS only provides the use of shell commands to complete Bluetooth mesh DFU, which is very unfriendly for developing Bluetooth mesh projects.

    I have completed the basic functions of Bluetooth mesh dfu and successfully tested it, but currently I need to copy all the files used to the project, which is too troublesome because ncs already has these files and I don't need to modify them

Children
No Data
Related