In Android's BLE API (BluetoothGatt) there are methods that deal with reliable writes:
public boolean beginReliableWrite ()
public void abortReliableWrite (BluetoothDevice mDevice)
public boolean executeReliableWrite ()
There is also a Callback for it (in BluetoothGattCallback):
public void onReliableWriteCompleted (BluetoothGatt gatt, int status)
I can't find any documentation on that. What is it? How is it different from "normal" (unreliable?) writes?
Reliable write allows checking back transmitted values and atomic execution of one or mutliple transmitted messages.
A good explaination of the reliable write procedure can be found in the BLE part of Mozillas Boot 2 Gecko Project documentation. Even though it's meant for JavaScript the description of
beginReliableWrite()
in particular is very helpful for understanding the process:You begin the reliable write,
set the value of the characteristic and write it.
The
writeCharacteristic()
call will trigger its 'normal' callback. The parametercharacteristic
contains the actual, written value which can be verified:Executing the reliable write will trigger the
onReliableWriteCompleted(BluetoothGatt gatt, int status)
callback.