This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mesh gatt and ble gatt

Hi. I have read the documentation and I have a couple of questions:

  1. What makes work different mesh_gatt and nrf_ble_gatt? Why can't they work together (maybe it's because of ATT_MTU, but I'm not sure).
  2. Why can I write and read a characteristic without function gatt_init in nrf5 sdk?
  3. how the characteristics created as in the BLE project in mesh will work? i created service and characteristics. they will communicate through the mesh gatt?
Parents Reply Children
  • 1. yes, but in your coexistence example gatt_init is commented out. In my example, gatt and mesh gatt do not work together.

    2. Why? gatt is responsible for communicating characteristics and services. 

    3. another question. I activated pb-gatt and proxy in config, but did not initialize. I use gatt_init. my treatments go to mesh_gatt_on_ble_evt and call hardfault. 
    static mesh_gatt_t m_gatt;
    NRF_SDH_BLE_OBSERVER (m_gatt_obs, NRF_MESH_GATT_BLE_OBSERVER_PRIO, mesh_gatt_on_ble_evt, & m_gatt);
    #endif

  • 1. It's commented out because the mesh_gatt.c already handle the ATT_MTU request. 

    2. Again the gatt_init() is only initialize the nrf_ble_gatt module which handles the ATT_MTU and the Data lenght request. It's not related to the service and characteristics.

    3. Please send what inside your "gatt_init" maybe it's different from my gatt_init. Please follow what I did in the example that I quoted. Note the change in  nrf_mesh_provisionee.c 

  • 3.  This is my project. The project has no uart.

    NRF_BLE_GATT_DEF(my_m_gatt);

    /**@brief Function for initializing the GATT module.
    */
    void gatt_init(void)
    {

    ret_code_t err_code = nrf_ble_gatt_init(&my_m_gatt, NULL);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&my_m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
    }

    Because of observers it works so incorrectly. NRF_BLE_GATT_DEF(my_m_gatt);      and 
    NRF_SDH_BLE_OBSERVER (m_gatt_obs, NRF_MESH_GATT_BLE_OBSERVER_PRIO, mesh_gatt_on_ble_evt, & m_gatt);
    Why are they processed together. nrf_ble_gatt_on_ble_evt and mesh_gatt_on_ble_evt.

  • As I mentioned the gatt_init() initialize nrf_ble_gatt () which handle the ATT_MTU update and Data length update. This is already handled by mesh_gatt so you don't need that module.

    Please remove the nrf_ble_gatt.h and nrf_ble_gatt.c from your project. 

    It has no direct impact to GATT services and characteristics. 

  • I deleted, now my program hangs in this place when disconnecting from the phone, when i run  advertising without mesh:
    .thumb_func
    .weak HardFault_Handler
    HardFault_Handler:
    b .

Related