Hello.
I need to transfer files from a phone to a BLE peripheral device. I have a small FatFS filesystem on an external flash chip on the device, and I'm now trying to decide how to transfer files to and from it. I'm using the nRF5 SDK.
I already have a custom BLE service on the device, which has characteristics for sending commands and associated parameters. This works well, but the assumption so far has been that all data for a command fits into a single characteristic write or read. I could extend this system to handle "appending" data to a file. And also to create, write, read, name, list and checksum files. But this seems like reinventing the wheel to me, so I'm looking at OTS to see if I could use it instead. I have been looking at the OTS server and client examples.
Before I start adding OTS to my application, I have a few questions:
- I haven't worked with L2CAP channels before. How do they coexist with regular GATT services? Can I simply treat it as "just another service"? Or is there a penalty in terms of power consumption or bandwidth usage on having an L2CAP channel open?
- How good is support for OTS in phones? I mean iOS and Android. If I choose to use OTS will I make life easier or harder for our app developers compared to a custom solution?
- How do I handle large files too big to hold in ram temporarily? I'm assuming this isn't a problem, but do I need a "flow control"-like mechanism to ensure that buffers won't overflow while waiting for the flash write to finish?
- Perhaps a detail at this point, but OTS objects have a type which is a UUID. Is there a generic "file" object type? Or perhaps a binary/text object type?
Lastly, an example combining OTS and a file system would be great. But I did see that someone asked for that just a few weeks ago.