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

Bluetooth mesh using prov bearer gatt and gatt proxy

Hello.

When I try to initialize provisioning bearer gatt with turned on the proxy, provisioning bearer is reconfigure the mesh_gatt which it will not work with proxy anymore.

mesh_gatt.c - initialisation function:

memcpy(&m_gatt.uuids, p_uuids, sizeof(mesh_gatt_uuids_t));
m_gatt.evt_handler = evt_handler;
...
NRF_MESH_ERROR_CHECK(sd_ble_gatts_characteristic_add(m_gatt.handles.service, &char_md, &attr_char_value, &m_gatt.handles.rx));
...
NRF_MESH_ERROR_CHECK(sd_ble_gatts_characteristic_add(m_gatt.handles.service, &char_md, &attr_char_value, &m_gatt.handles.tx));

m_gatt.p_context = p_context;

After the provisioning bearer initialization, the proxy char handles and event handler will be replaced.

What I am doing wrong? Do I need to init the provisioning bearer gatt if already have proxy?

  • Hi.

    What is it that you are trying to do here?

    Are you using our Mesh SDK, trying to merge the provisioning example with one of our proxy examples?

    Best regards,
    Joakim

  • My application is based on the gatt proxy example. I tried to rewrite the example so that the provisioning began at the button press. After I moved the provisionee bearer initialization, that it inits when the application starts, the proxy stopped working.

    The function mesh_provisionee_prov_start in my application has only call nrf_mesh_prov_listen.

    The functions calls nrf_mesh_prov_generate_keys, nrf_mesh_prov_init, nrf_mesh_prov_bearer_gatt_init, nrf_mesh_prov_bearer_add moved to init function which I call at startup.

  • Hi.

    The provisioner example in our SDK does start the provisioning process on a button press already. Did you take a look at that?

    From the light switch examples README (sdk_root/examples/light_switch/README.md):
    After a reset, press Button 1 on the provisioner to start the provisioning and configuration of the devices. The provisioner first provisions and configures the client and then moves on to provision and configure the servers, one by one.

    Best regards,
    Joakim

  • Thanks for your reply. I am using mesh_provisionee, because smartphone app is provisioner. A device is not provisioner. My code based on light_switch_proxy_server example. That example starts provisionee if device is unprovisioned. My modification is - start listening on button press.

    I tried to trace a fault and found mesh_gatt_init call inside call nrf_mesh_prov_bearer_gatt_init. Inside proxy_init the same function is called (mesh_gatt_init). mesh_gatt module has static structure m_gatt which contains the char handles. The second call of mesh_gatt_init rewrites the char handles. In the result, the gatt prov bearer char handles replace char handles of proxy in the m_gatt structure. Because of this, I don't have access to the proxy.

    Is it a bug or I am using features in the wrong way?

Related