Hello,
I need to send logged sensor data in external 4MB flash to a phone via BLE.
I am using a nRF52840 based module on a custom PCB. I am using SDK v14.2.
I am using the Queue module to read logged data from in the flash and store it in a queue, which I then send to the phone via a suitable GATT characteristic.
My code is something like this:
- In the main(), inside a while loop, I have 2 functions queue_log() ans send_log().
- In queue_log() I read from flash and store in a queue. The type stored in the queue is a 12 byte structure.
- In send_log(), I send the each of the values stored in the queue as a 12 byte each GATT characteristic using sd_ble_gatts_hvx().
But I am facing some issues. How best can I achieve this, considering that I need to send every value I store in the queue, hence I cannot overwrite the queue.
If I use NRF_QUEUE_MODE_NO_OVERFLOW ,I get a NRF_ERROR_NO_MEM, meaning that the queue is full.
What queue size should I use, considering that I might have upto 4MB of data to send?
And what scheme can I use to queue up and send this data?
Thanks