I send data over BLE using the following call
[peripheral writeValue:dataPiece forCharacteristic:characteristic
type:CBCharacteristicWriteWithResponse];
when the dataPiece size is 180 bytes
or less everything works fine: accepting device receives all the data, on calling device corresponding callback (peripheral: didWriteValueForCharacteristic: error:
) is called. When the size goes large (>180
) receiving device still gets all the data (in two chunks: of 180 bytes
and the rest). However in the latter case the callback on transmitting device is not called.
Also [peripheral maximumWriteValueLengthForType:CBCharacteristicWriteWithResponse]
returns 512
which is more than 180
, so I would expect 200
to work fine.
Am I missing something (obviously yes, but what)?
For peripheral, it should respond descriptor when central call
readValueForDescriptor:
method.If it did not respond, central can not write data to it.
See:
(void)readValueForDescriptor:(CBDescriptor *)descriptor;
(void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(nullable NSError *)error;