This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Prepare Write Request

Hi Team,

Is there any example to understand Prepare Write Request/Prepare Write Response?

In ble_uart_app example, I am getting p_ble_evt->header.evt_id = 2 if I put printf in default case in on_ble_evt function.

Regards,

Milan Joshi

Parents
  • Is it S110 or S120 you are working with?

    My recommendation would be to look at the SDK documentations Message Sequence Charts first. If you want automated control (the simplest appproach) you let the softdevice take care of the data copying. NOTE: In this case you need a buffer bigger than the data you are going to hold! ceil(BUF_SIZE/18)*24 + 2 would be a sufficient size for the buffer in this case.

  • Hi shibshab,

    Tried what you suggested and it worked but in the end it give error shown in snap below. any idea?

    image description

    following is the part of the code that I have tried for this:

    uint8_t data[1024];
    ble_user_mem_block_t *mydata;
    mydata->p_mem = data;
    mydata->len = 1024;
    err_code = sd_ble_user_mem_reply(m_conn_handle, mydata);
    
Reply
  • Hi shibshab,

    Tried what you suggested and it worked but in the end it give error shown in snap below. any idea?

    image description

    following is the part of the code that I have tried for this:

    uint8_t data[1024];
    ble_user_mem_block_t *mydata;
    mydata->p_mem = data;
    mydata->len = 1024;
    err_code = sd_ble_user_mem_reply(m_conn_handle, mydata);
    
Children
No Data
Related