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

Write Queued Characteristic with Less than 20 bytes

Good afternoon,

Following up my previous case, to which I got no reply, how can I use a queued write characteristic to write less than 20 bytes of data?

I'm using it to mainly write more than 20 bytes of data but when I write less than 20 bytes it just halts the application. How can I overcome it?

Thank you,

João

Parents
  • HI Joao, 

    I sincerely apologize for the very late reply on this question and the other QWR related question you have posted. I've been looking at the QWR module and it appears that it does not handle regular write requests with authorization, i.e. it is not replying to a write auth. request and that is why it is hanging. I added the following code to the switch-case in on_rw_authorize_request() in nrf_ble_qwr.c

        case BLE_GATTS_OP_WRITE_REQ:
                auth_reply.type                     = BLE_GATTS_AUTHORIZE_TYPE_WRITE;
                auth_reply.params.write.gatt_status = BLE_GATT_STATUS_SUCCESS;
                auth_reply.params.write.update = 1;
                ret_code_t err_code = sd_ble_gatts_rw_authorize_reply(p_qwr->conn_handle,&auth_reply);
                if (err_code != NRF_SUCCESS)
                {
                    // Report error to application.
                    p_qwr->error_handler(err_code);
                }
                break;
     

    This appears to solve the issue of the application halting when writing less than 20 bytes. I will look more into this tomorrow. 

    Bjørn 

  • Hi Bjørn,

    Thank you for your reply.

    Indeed now it doesn't halt when writing less than 20 bytes, still the write request is not executed in the end, which indicates that something is still missing to forward the write command and respective data to execution.

    Looking forward to your reply,

    Thank you,

    João

Reply Children
No Data
Related