nRF52832 Sends 2KB data in less than 1s

Hi,

I am reading a chunk of 2KB data from a sensor every interrupt generated from the sensor. The interrupt occurs less than 1 second and I have to transmit it via Bluetooth. I got an NRF error code 19 when I divide the 2KB data into 20 frames before transmitting the data in a for loop. I was wondering if there is a better way to handle it.

Thanks in advance,

Peter

Parents
  • Hi Peter,

    Based on the error you describe I assume you are using the nRF5 SDK? Are you sending data as notifications? That will be the most efficient want. However, there is a limit to how much data that can be buffered, and when you get NRF_ERROR_RESOURCES (19) returned from sd_ble_gatts_hvx() you need to wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event before you attempt to send more.

    If this does not answer the question, then please describe a bit more what you are doing.

Reply
  • Hi Peter,

    Based on the error you describe I assume you are using the nRF5 SDK? Are you sending data as notifications? That will be the most efficient want. However, there is a limit to how much data that can be buffered, and when you get NRF_ERROR_RESOURCES (19) returned from sd_ble_gatts_hvx() you need to wait for the BLE_GATTS_EVT_HVN_TX_COMPLETE event before you attempt to send more.

    If this does not answer the question, then please describe a bit more what you are doing.

Children
Related