public static interface RxBleConnection.LongWriteOperationBuilder
CharacteristicLongWriteOperation builder.| Modifier and Type | Method and Description |
|---|---|
<any> |
build()
Build function for the long write
|
RxBleConnection.LongWriteOperationBuilder |
setBytes(byte[] bytes)
Setter for a byte array to write
This function MUST be called prior to
build() |
RxBleConnection.LongWriteOperationBuilder |
setCharacteristic(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
Setter for a
BluetoothGattCharacteristic to write to
This function or setCharacteristicUuid(UUID) MUST be called prior to build() |
RxBleConnection.LongWriteOperationBuilder |
setCharacteristicUuid(java.util.UUID uuid)
Setter for a
UUID of the BluetoothGattCharacteristic to write to
This function or setCharacteristic(BluetoothGattCharacteristic) MUST be called prior to build() |
RxBleConnection.LongWriteOperationBuilder |
setMaxBatchSize(int maxBatchSize)
Setter for a maximum size of a byte array that may be write at once
If this is not specified - the default value of the connection's MTU is used
|
RxBleConnection.LongWriteOperationBuilder |
setWriteOperationAckStrategy(RxBleConnection.WriteOperationAckStrategy writeOperationAckStrategy)
Setter for a strategy used to mark batch write completed.
|
RxBleConnection.LongWriteOperationBuilder |
setWriteOperationRetryStrategy(RxBleConnection.WriteOperationRetryStrategy writeOperationRetryStrategy)
Setter for a retry strategy in case something goes wrong when writing data.
|
RxBleConnection.LongWriteOperationBuilder setBytes(byte[] bytes)
build()bytes - the bytes to writeRxBleConnection.LongWriteOperationBuilder setCharacteristicUuid(java.util.UUID uuid)
UUID of the BluetoothGattCharacteristic to write to
This function or setCharacteristic(BluetoothGattCharacteristic) MUST be called prior to build()uuid - the UUIDRxBleConnection.LongWriteOperationBuilder setCharacteristic(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
BluetoothGattCharacteristic to write to
This function or setCharacteristicUuid(UUID) MUST be called prior to build()bluetoothGattCharacteristic - the BluetoothGattCharacteristicRxBleConnection.LongWriteOperationBuilder setMaxBatchSize(int maxBatchSize)
maxBatchSize - the maximum size of a byte array to write at onceRxBleConnection.LongWriteOperationBuilder setWriteOperationRetryStrategy(RxBleConnection.WriteOperationRetryStrategy writeOperationRetryStrategy)
BleException is raised,
a RxBleConnection.WriteOperationRetryStrategy.LongWriteFailure object is emitted.
RxBleConnection.WriteOperationRetryStrategy.LongWriteFailure contains both the BleException and the batch number
for which the write request failed. The RxBleConnection.WriteOperationRetryStrategy.LongWriteFailure emitted by the
writeOperationRetryStrategy will be used to retry the specified batch number write request.
writeOperationRetryStrategy - the retry strategyRxBleConnection.LongWriteOperationBuilder setWriteOperationAckStrategy(RxBleConnection.WriteOperationAckStrategy writeOperationAckStrategy)
writeOperationAckStrategy - the function that acknowledges writing of the batch of bytes. It takes
an Observable that emits a boolean value each time the byte array batch
has finished to write. Boolean.TRUE means that there are more items in the buffer,
Boolean.FALSE otherwise. If you want to delay the next batch use provided observable
and add some custom behavior (delay, waiting for a message from the device, etc.)<any> build()