How to use the QWR module

Hi Nordic, 

how can i use the QWR module on the ble_nus_uart peripheral example?  In the example we use nrf_ble_qwr_init() to initialize the module but i don't get the effect of it. 

I want to use it because i need to transmit data as fast as possible using the function ble_nus_data_send(). 

I thought that by enabling this module (QWR) i could get the ble messages transmitted via the ble_nus service automatically queue in case they could not be transmitted. But that is not the case. If there are no resources the transmission is  simply not done. I don't see any basic queue done, neither an option to increase the size of queue.

Is my understanding from the QWR module correct?

Is there something that i'm missing? 

Is there any example that i could use to get familiar with this module? 

Any help is welcome. Thanks in advance. 

Ps: using sdk 17

  • Hi

    The QWR module is only used for write requests, not write commands. The reason for this is that the Bluetooth stack can only handle one write request at a time, and if you want to send multiple of them it is necessary to queue them in the application. 

    The ble_nus_data_send() functions uses notifications, which is a type of command and not request, and as such the QWR module is not relevant. 

    In order to maximize throughput using notifications it is necessary to upload as many packets as you can until the NRF_ERROR_RESOURCES error is returned, and then hold off until the BLE_GATTS_EVT_HVN_TX_COMPLETE event occurs, at which point you can upload more notifications to the stack. 
    For more context on this please refer to this case

    Best regards
    Torbjørn

Related