This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Changing Gatt Characteristic Properties?

If I have some value and this value has become out of desired range I want to change property from indicate to notify.

I only found function sd_ble_gatts_characteristic_add() to set up properties but couldn't find one to update.

Could you please tell me how to do so.

What will happen if notify is set and link is lost? What will S110 do?

Update:

Is it possible to change GATT characteristic properties on a fly? How?

Edit: one sentence question, format, update

Parents
  • No, you cannot change the database on the fly.

    In fact, if you do change the database you must enable and indicate the service changed characteristic to the peer. This is because the peer side is allowed to cache the database structure, and any changes done to the structure requires a (partial) rediscovery. Not sending the Service Changed will in that case be breaking the specification. Also, changing the database should generally only be used if you want to reinitialize the device with a new profile, so I think you need to consider other options for your use-case.

    I do think it is allowed to let a characteristic be both notifiable and indicateable though, which means you could have both properties at once and decide within the app what you want to do. The peer application must then enable for both indications and notifications (0x0003) to allow you to do both operations.

  • In the call to HVX you can choose between setting the notification and the indication flag. In addition, you will not receive a handle value confirmation for the notifications, so any code depending on these should not be run for notifications.

Reply Children
No Data
Related