We have an application where we need to download a fairly large amount of data (0.5-5MB) via BlueTooth serial (from an embedded device (STM32), via an RN-41 or similar, to the Android app). Using the BlueTooth Chat example as a basis, we are finding that astreams_Error gets called somewhere during the download (with an error "Connection Reset by Peer"), resulting in the connection being dropped.
Any tips/ideas for an application architecture to handle this scenario, in order to get the data transferred over both reliably and as quickly as possible, would be appreciated!
- Adding "breathers' (delays / breaks) in the data transmission from the embedded device seems to help, but is not a reliable / consistent method.
- A request/acknowledgement scheme (where every few bytes of data are acknowledged before further data is transmitted) works, but is painfully slow.
Any tips/ideas for an application architecture to handle this scenario, in order to get the data transferred over both reliably and as quickly as possible, would be appreciated!