CoreBluetooth - Send and receive a large data packet

0

I'm developing an application for iOS using only CoreBluetooth, in the same application the device could be a Central or a Peripheral. Well, everything works fine, until I try to send a packet of data above the limit allowed by the slave (peripheral device that commands the limit of data that can be trafficked to each request of the exchange).

I have 3 characteristic:

    CBCharacteristicPropertyNotify
    CBCharacteristicPropertyRead
    CBCharacteristicPropertyWrite

I can send a very large package from the peripheral to the central office using the form indicated by Apple in the BTLE_Transfer app (CBCharacteristicPropertyNotify), however, I need the following methods to send a larger data package than stipulated:

    - (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type;
    - (void)readValueForCharacteristic:(CBCharacteristic *)characteristic;
When I call these methods with a small byte packet, everything happens normally, but when this packet increases, it always returns in the delegate responsible for the response of each method, a packet of 628 bytes (smaller than the packet that was sent by other side). If you send above 628 bytes, 628 bytes are always returned, and the date on the other side (peripheral or central) can not be deserialized.

Does anyone know why this happens? I noticed that when I send a 2000-byte packet for example, the delegate responsible for readValueForCharacteristic is called 4 times, however, I can not mount the package correctly. Would anyone have an explanation?

    
asked by anonymous 18.11.2015 / 19:07

0 answers