I have an app which will be acting as a BLE central (scanning for peripherals), running on iOS 8 and above. Also I have a custom accessory acting as a peripheral (advertises a custom service with custom characteristics).
I found out that default MTU and characteristic sizes are 20 bytes, but they seem to be negotiable up to 512 bytes. Larger sizes would be really useful for my app because I intend to be sending about 20KB of data in bursts, about 10 times per hour.
As I understand, both peripheral and central should negotiate MTU (and characteristic?) sizes during connection phase.
Does this happen automatically or do I have to write some special code in my central app?
How do I determine current MTU and supported max characteristic size in my application?
Will the sizes remain constant during single connection session or can they suddenly change, and then how can my app find out when the change occurs?
I've been reading BLE specification documents and Apple developer documents, but still it's not clear how BLE MTU and characteristic size negotiation works in practice and how to deal with it correctly in my code.
I might be able to contact the peripheral accessory manufacturer and ask for some software tweaks on their side, if necessary; thus I can be sure that they will support larger MTU sizes. I'm just not sure what should I do on iOS side.