GATT prepare/execute write with NCS

Hi

I'm using the nRF Connect SDK v2.7.0 in central/client role to write data into a characteristic on a peer device.

I've seen that the function bt_gatt_write() automatically uses the prepare-/execute-write-requests when an offset is used or the data-length is bigger than the MTU size.

Are there also a publicly available GATT functions to use prepare- and execute-write-requests on purpose?

I'm asking this because these requests would also allow to prepare-writes for different handles and execute them all at once (which seems not possible with bt_gatt_write()).

Many thanks in advance.

Best regards

Remo

Parents
  • Even though it would be possible with a multi-handle prepare/execute write using the ATT protocol, there is no such defined method in the GATT standard using normal writes, as a client. This is only possible with so called "Reliable Writes" but in order to use these the characteristics must have the "Reliable Write" property enabled in their declaration. Zephyr doesn't support this feature as a client as far as I can see. In any case, it is a relatively inefficient method to transfer data using prepare/execute writes because all data is echoed back before committing. I would suggest to simply use a longer MTU instead which is nowadays supported on all popular platforms.

Reply
  • Even though it would be possible with a multi-handle prepare/execute write using the ATT protocol, there is no such defined method in the GATT standard using normal writes, as a client. This is only possible with so called "Reliable Writes" but in order to use these the characteristics must have the "Reliable Write" property enabled in their declaration. Zephyr doesn't support this feature as a client as far as I can see. In any case, it is a relatively inefficient method to transfer data using prepare/execute writes because all data is echoed back before committing. I would suggest to simply use a longer MTU instead which is nowadays supported on all popular platforms.

Children
No Data
Related