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

Queued write module

Hi,

I configured nrf_ble_qwr to use 256 byte long buffer in my BLE peripheral. I registered my value handles (2) which I want to support long writes using nrf_ble_qwr_attr_register. I set NRF_BLE_QWR_MAX_ATTR = 2. On connected event I assign connection handle using nrf_ble_qwr_conn_handle_assign.

Still, I don't receive any event from nrf_ble_qwr in my callback (qwr_init.callback).

When I perform long write of total size less than 256 bytes from BLE central to my peripheral, nrf_ble_qwr module receives BLE_EVT_USER_MEM_REQUEST and after that  BLE_EVT_USER_MEM_RELEASE events and no event is propagated to my application.

How to use nrf_ble_qwr? I saw examples\ble_peripheral\experimental\ble_app_queued_writes .I use latest SDK.

Parents
  • Hi,

    The example you refer to, the Queued Writes Application, is probably the best example for seeing the Queued write module in use. However, I did not understand why you want to use the queued writes module?

    Just so there are no misunderstandings I want to emphasize that queued writes only make sense if you want to synchronize writes to multiple characteristics, so that the change take effect simultaneously. If you just want to write to a long characteristic and have to split it over multiple writes, then you should write with offset instead. That is simpler and has less overhead.

  • Thanks. I have BLE central that splits long data to several chunks and then writes it to my characteristics using several "prepare write requests" (it sets offset and length of current chunk) and then it executes "execute write request". Am I going to receive this data using Queued write module or how in SDK 15?

  • If you have a requirement to use queued write because you cannot control the central, then yes, you can use the queued write module. But the scenario you describe where you just need to split long data in several chunks is not a good use case for queued writes (it is simply overcomplicated, since it is designed for a different and more complex use case), so if you can change the central to avoid it that would probably be the best.

    If you decide to stick with queued writes, you can refer to the queued writes module documentation in addition to the example.

Reply
  • If you have a requirement to use queued write because you cannot control the central, then yes, you can use the queued write module. But the scenario you describe where you just need to split long data in several chunks is not a good use case for queued writes (it is simply overcomplicated, since it is designed for a different and more complex use case), so if you can change the central to avoid it that would probably be the best.

    If you decide to stick with queued writes, you can refer to the queued writes module documentation in addition to the example.

Children
Related