I'm Working on iOS Application(Objective-C) for Bluetooth watch which using BLE(CoreBluetooth), and my watch is having GATT Bluetooth Profile, iOS application minimum support is from iOS7.
I wants to know How can we do data transfer between iOS device and external device using Core Bluetooth framework.
Actually I'm working on the Firmware upgrade section of my Bluetooth watch, My iOS application will get Firmware code (binary data) from web service whenever any update received and then it will send data to Bluetooth watch.
I have searched and got one Apple Sample code: BTLE_Transfer: https://developer.apple.com/Library/ios/samplecode/BTLE_Transfer/Introduction/Intro.html
I guess sample code was not useful in my case as its having Central and Peripheral both code and transferring data between two iOS device.
is there any other way apart from this sample code for BLE data transfer? or it's possible with this sample code only?(if yes how?)
UPDATED:
My device have 1 service which have 2 characteristic one for read and one for write.
According to my workflow using write charateristic:
[MYDEVICEINSTANCE writeValue:NSDATACHUNK forCharacteristic:WRITECHARACTERISTIC type:CBCharacteristicWriteWithResponse];
[MYDEVICEINSTANCE setNotifyValue:TRUE forCharacteristic:READCHARACTERISTIC];
[MYDEVICEINSTANCE readValueForCharacteristic:READCHARACTERISTIC];
My query:
I wants to confirm MTU maximum limit allowed by Apple for External device communication from iOS application, which I'm starting in step-1 by sending NSDATACHUNK to BLE Watch from iOS app using writeValue
I have tested that I can send NSDATACHUNK of MTU=255 size and BLE watch is receiving same successfully.
I have found in "Apple Sample code: BTLE_Transfer" they are using MTU=20 but, I guess that sample code is for iOS device to iOS device communication (Please, correct me if I'm wrong)
So, If I use MTU=250 in my iOS application for BLE communication is there any chance that apple will reject my Application?
Or is there any one that can say what is the maximum limit allowed by Apple for MTU?
Every suggestion are appreciated,
Thanks in advance
You can use whatever MTU size you want (up to 512).
The value that the connection will use is always the minimum between yours and theirs.
So, if for example they want to use MTU equal to, let's say, 50, then if your MTU is lower than 50, that one will be used; otherwise, whichever value you select above 50 is meaningless, as 50 gets picked.