Hi!
We're holding a large amount of data in flash, and would like to pass it onto the central when connected.
Currently, we're following this process:
1. Read one buffer of size X from flash into a Ram buffer of size X.
2. Start advertising and connect to a central
3. Pass the entire ram buffer to the central in chuncks
4. Disconnect from the central
5. If more Flash buffers are available, Go back to 1 until no more data is stored in flash.
This seems inefficient to me. I'd rather read the flash buffers while we're connected, and not terminate the connection until all flash has been transmitted.
Is there a problem with the approach I'm thinking of? The flash read is non blocking, so the connection may stay open for a bit of time.
Which approach is more efficient in terms of power consumption?
Is there a recommended way of doing this to minimize idle time? (for example have 2 ram buffers- one for transmitting the data over BLE, one for reading the next data from flash?)
Thanks!