2

I have a custom BLE peripheral that can send a notification data packet to a central. The device sends packets of 200 bytes at a time, and the central is expected to register for notification of characteristic updates on the device. Note this device was not designed for read operations and only supports streaming notifications to central.

In android 7 The central software just works with no problems and the phone (central) receives 200 bytes in a single notify event. - this works just fine.

I am porting the code for use on Apple devices using swift. I am using an iPad with iOS 9.3 and core blue tooth to test my software.

The iPad is programmed as a central, to receive notifications, but when the callback didUpdateValueForCharacteristic fires I only ever see the length of the data from the characteristic.value as being 155bytes. This means that 45 bytes are lost somewhere. BTW - The same code was also tested on a mac book air, and in that case the data received by the central was only 101bytes not 200 bytes either.

I dont see any mention in the corebluetooth API documents of a 155byte limitation anywhere. Am I supposed to call some extra function, or should I have set up the notifications a special way to do something to get the remainder of the bytes? If so does anyone know what?

  • please read this answer https://stackoverflow.com/questions/41899838/not-able-to-scan-through-cbcentral-manager-with-service-id-for-ibecon-signal/41955750#41955750 – IOS Singh Sep 18 '17 at 10:02
  • @IOSSingh how is that remotely applicable? – Paulw11 Sep 18 '17 at 10:16
  • @JonnyProgrammer. It seems that your peripheral is not respecting the MTU size that has been negotiated with the central; it assumes that it can always send 200 bytes. This is not always the case. You need to change the code in the peripheral – Paulw11 Sep 18 '17 at 10:17
  • hi @ ios Singh, are you suggesting the CBCentralmanager makes a call to a function when it receives data? – JonnyProgrammer Sep 18 '17 at 10:28
  • Thanks Paulw I'l look at the peripheral code (it works perfectly on android...) – JonnyProgrammer Sep 18 '17 at 10:30
  • Please check your ios device bluetooth version.its 4.1 or 4.2? – Deepak Tagadiya Sep 19 '17 at 07:32

0 Answers0