I'm working on support for several custom characteristics that require long write support. I'm using the nrf_ble_qwr library, and I've noticed what seems to be a discrepancy between the message sequence charts and actual behavior.
We're using the nRF52832 with S132 softdevice 5.0.0, SDK 14.2.0
nrf_ble_qwr requires write authorization (wr_auth = true when adding characteristic). This corresponds, I believe to the message sequence chart "GATTS Queued Writes: Stack handled, one or more attributes require authorization" found here.
The chart indicates that there is no BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event for the first data block, only the BLE_EVT_USER_MEM_REQUEST. Then, the chart shows a BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event for the second (and presumably all subsequent) blocks.
In reality, I'm getting a BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST for the first block immediately after the BLE_EVT_USER_MEM_REQUEST and call to sd_ble_user_mem_reply(). This also makes more sense, as it allows the app (in this case the QWR library) to check authorization for the first block.
First, is this really an error, or am I missing something?
Second, if it is incorrect, it seems to be present in all of the versions of the documentation including the most recent.
Finally, I haven't checked yet to be sure, but I assume that the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event would have to happen before the SD sends the ATT Prepare Write Response back to the peer for the first handle.
-Philip