Custom UUID for SMP service

Hi, 

I am using NCS. 

I am using SMP service through BLE, and for security reason I would like to have a custom UUID for the BLE service.

UUID is defined in zephyr\include\zephyr\mgmt\mcumgr\transport\smp_bt.h.

Is there a way, without modifying zephyr repo, to have a custom UUID ?

I have created on app side, the same path : \include\zephyr\mgmt\mcumgr\transport\smp_bt.h and created a copy of smp_bt.h, with only a difference on UUID.

I think, by modifying CmakeLists.txt, or prj.conf, it is possible to indicate that this file should be taken instead of the one in zephyr. 

Can you help on that ?

Parents
  • Hi Antoine,

    This is indeed possible. Mirror the include path inside your application and place your version there. Your app’s include directory is searched before the SDK’s, so the compiler will choose the one inside your application instead of the default SDK header file.

    In your application directory, create:

    include/zephyr/mgmt/mcumgr/transport/smp_bt.h

    You also need to ensure the include directory is added in CMake. In your CMakeLists.txt add:

    target_include_directories(app PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/include
    )


    Best regards,
    Benjamin

     

Reply
  • Hi Antoine,

    This is indeed possible. Mirror the include path inside your application and place your version there. Your app’s include directory is searched before the SDK’s, so the compiler will choose the one inside your application instead of the default SDK header file.

    In your application directory, create:

    include/zephyr/mgmt/mcumgr/transport/smp_bt.h

    You also need to ensure the include directory is added in CMake. In your CMakeLists.txt add:

    target_include_directories(app PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/include
    )


    Best regards,
    Benjamin

     

Children
No Data
Related