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

sd_ble_evt_get questions

  1. I'm seeing the sd_ble_evt_get return NRF_ERROR_DATA_SIZE even though the supplied buffer and length param are larger than the event length. Is this a known benign issue?

If the following code

rc = sd_ble_evt_get(NULL, &evt_len); evt_buff_len = evt_len; // evt_buff_len = evt_len + 4; <-- in case evt_len is 0 rc = sd_ble_evt_get(myBuffer, &evt_buff_len);

if the evt_len returned is 0, rc is 12 or NRF_ERROR_DATA_SIZE Even if the evt_buff_len is set to 4, the rc is NRF_ERROR_DATA_SIZE

All other times, the rc is 0 (NRF_SUCCESS).

when there is no prior call the get the event length - following is executed in the same scenario as the above code rc = sd_ble_evt_get(NULL, &evt_len); evt_buff_len = 60; rc = sd_ble_evt_get(myBuffer, &evt_buff_len);

rc is NRF_ERROR_DATA_SIZE more often than when the size was originally obtained even when the evt_len is known to be smaller than the evt_buff_len.

  1. What is the max time that can elapse before I invoke sd_ble_evt_get to get an event from the BLE stack?

Thanks

Parents
  • The buffer is word aligned in memory. This was validated early on.

    There would have been other issues if it had not been to put things mildly.

    The main reason for using the event get function is that we have our own interrupt handler.

    What suggestions would you have to incorporate the soft device_handler library with existing interrupt handler mechanisms that a developer has?

    Thanks,

    David

Reply
  • The buffer is word aligned in memory. This was validated early on.

    There would have been other issues if it had not been to put things mildly.

    The main reason for using the event get function is that we have our own interrupt handler.

    What suggestions would you have to incorporate the soft device_handler library with existing interrupt handler mechanisms that a developer has?

    Thanks,

    David

Children
Related