Change BLE attribute dynamically on NCS

HI,

I am working on a NRF54L15 with NCS 2.9. I have a service my_service created with BT_GATT_SERVICE_DEFINE, with two characteristics, "Protected" and "Password". "Protected" is read-only and "Password" is read-write.I would like to know if it is possible to change a BLE interface after it has been created, and also if connected, for example:

  • change permission: when connected, if "Password" is written with a certain value ( correct password), then "Protected" should we writable
  • make appear or disappear a characteristic with the same process as in first point

I have seen that I have access to the attributes of the service with attrs field, so the perm field.

Thanks in advance !

Parents
  • Hi ,

    Thanks for the link, it seems interesting, but if I understand well it is used to add dynamically a service.

    What I want to do is to modify an existing service, and if possible if a client is already connected.

    More specifically, I want to modify the permissions of a characteristic.

    I can see that you enable the "Service changed" characteristic from the GATT service, do you think it can manage my case ?

    Do you have an example of implementation for my case ?

    Thanks in advance !

Reply
  • Hi ,

    Thanks for the link, it seems interesting, but if I understand well it is used to add dynamically a service.

    What I want to do is to modify an existing service, and if possible if a client is already connected.

    More specifically, I want to modify the permissions of a characteristic.

    I can see that you enable the "Service changed" characteristic from the GATT service, do you think it can manage my case ?

    Do you have an example of implementation for my case ?

    Thanks in advance !

Children
Related