Writing multiple Bluetooth low energy response values โ€‹โ€‹with a response

Specification Bluetooth Core V4.0 Vol. 3 Part G Section 4.9.3 indicates that the attribute protocol request procedure is used to record attribute values โ€‹โ€‹with a response.

The Bluetooth Core V4.0 Vol 3 Part F Specification Section 3.3.2 describes that

As soon as a client sends a request to the server, this client should not send another request to the same server until a PDU response is received.

I want to write multiple response values โ€‹โ€‹in an iOS app using CoreBluetooth. Do I have to manage this specification myself? Or just, can I use - writeValue:forCharacteristic:typeto write all values โ€‹โ€‹at once, and iOS controls that each request is sent only after the previous one is processed?

I somehow guess that iOS will cope with this, because according to Bluetooth Core Spec V4.0 Vol 3 Part F Section 3.4.5.2 Write Response does not contain a link to the written characteristic. However, the method - peripheral:didWriteValueForCharacteristic:errorassumes that iOS somehow tracks what characteristics the response is associated with.

Can someone confirm or deny this?

+5
source share
2 answers

I donโ€™t think you need to worry about ATT / GATT so much when dealing with CB. The reason is that many people who use CB do not have access to the Bluetooth Core 4.0 specification, and they should not read them.

, CB , , , , . , .

, writeValue , CB , ATT . , .

+2

" " i.e

[self peripheral] writeValue: valueToWrite forCharacteristic: dataPointCharacteristic type: CBCharacteristicWriteWithResponse];

- 14 - . " " , - i.e. .

, " Bluetooth Core Spec V4.0 Vol 3 Part F 3.4.5.2" " " , [characteristc ], , ios . , ( BLE) .

- - BLE "WithReponse" "Do Task # 1" , BLE "OK!". , " โ„– 1", - : ", , ". , , :)

+1

All Articles