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.

  • See devzone.nordicsemi.com/.../a00247.html If a value is both indicatable and notifyable, and the peer has written 0x03 to the CCCD (enable both), then you can set the "type" field in the ble_gatts_hvx_params_t struct to either BLE_GATT_HVX_NOTIFICATION or BLE_GATT_HVX_INDICATION. If you send indications, you must then wait for a confirm event (BLE_GATTS_EVT_HVC) before you are allowed to send a new one. With notifications, there is no such limit. Does that answer your question?

Reply
  • See devzone.nordicsemi.com/.../a00247.html If a value is both indicatable and notifyable, and the peer has written 0x03 to the CCCD (enable both), then you can set the "type" field in the ble_gatts_hvx_params_t struct to either BLE_GATT_HVX_NOTIFICATION or BLE_GATT_HVX_INDICATION. If you send indications, you must then wait for a confirm event (BLE_GATTS_EVT_HVC) before you are allowed to send a new one. With notifications, there is no such limit. Does that answer your question?

Children
No Data
Related