public final class LongWriteOperationBuilderImpl extends java.lang.Object implements RxBleConnection.LongWriteOperationBuilder
| 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
RxBleConnection.LongWriteOperationBuilder.build() |
RxBleConnection.LongWriteOperationBuilder |
setCharacteristic(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
Setter for a
BluetoothGattCharacteristic to write to
This function or RxBleConnection.LongWriteOperationBuilder.setCharacteristicUuid(UUID) MUST be called prior to RxBleConnection.LongWriteOperationBuilder.build() |
RxBleConnection.LongWriteOperationBuilder |
setCharacteristicUuid(java.util.UUID uuid)
Setter for a
UUID of the BluetoothGattCharacteristic to write to
This function or RxBleConnection.LongWriteOperationBuilder.setCharacteristic(BluetoothGattCharacteristic) MUST be called prior to RxBleConnection.LongWriteOperationBuilder.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.
|
public RxBleConnection.LongWriteOperationBuilder setBytes(byte[] bytes)
RxBleConnection.LongWriteOperationBuilderRxBleConnection.LongWriteOperationBuilder.build()setBytes in interface RxBleConnection.LongWriteOperationBuilderbytes - the bytes to writepublic RxBleConnection.LongWriteOperationBuilder setCharacteristicUuid(java.util.UUID uuid)
RxBleConnection.LongWriteOperationBuilderUUID of the BluetoothGattCharacteristic to write to
This function or RxBleConnection.LongWriteOperationBuilder.setCharacteristic(BluetoothGattCharacteristic) MUST be called prior to RxBleConnection.LongWriteOperationBuilder.build()setCharacteristicUuid in interface RxBleConnection.LongWriteOperationBuilderuuid - the UUIDpublic RxBleConnection.LongWriteOperationBuilder setCharacteristic(android.bluetooth.BluetoothGattCharacteristic bluetoothGattCharacteristic)
RxBleConnection.LongWriteOperationBuilderBluetoothGattCharacteristic to write to
This function or RxBleConnection.LongWriteOperationBuilder.setCharacteristicUuid(UUID) MUST be called prior to RxBleConnection.LongWriteOperationBuilder.build()setCharacteristic in interface RxBleConnection.LongWriteOperationBuilderbluetoothGattCharacteristic - the BluetoothGattCharacteristicpublic RxBleConnection.LongWriteOperationBuilder setMaxBatchSize(int maxBatchSize)
RxBleConnection.LongWriteOperationBuildersetMaxBatchSize in interface RxBleConnection.LongWriteOperationBuildermaxBatchSize - the maximum size of a byte array to write at oncepublic RxBleConnection.LongWriteOperationBuilder setWriteOperationRetryStrategy(RxBleConnection.WriteOperationRetryStrategy writeOperationRetryStrategy)
RxBleConnection.LongWriteOperationBuilderBleException 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.
setWriteOperationRetryStrategy in interface RxBleConnection.LongWriteOperationBuilderwriteOperationRetryStrategy - the retry strategypublic RxBleConnection.LongWriteOperationBuilder setWriteOperationAckStrategy(RxBleConnection.WriteOperationAckStrategy writeOperationAckStrategy)
RxBleConnection.LongWriteOperationBuildersetWriteOperationAckStrategy in interface RxBleConnection.LongWriteOperationBuilderwriteOperationAckStrategy - 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.)public <any> build()
RxBleConnection.LongWriteOperationBuilderbuild in interface RxBleConnection.LongWriteOperationBuilder