Constructor and Description |
---|
Builder() |
Builder(java.util.UUID characteristicUuid) |
Builder(java.util.UUID serviceUuid,
java.util.UUID characteristicUuid) |
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
build()
Builds, and returns the list of
BleRead s. |
BleWrite[] |
buildArray() |
B |
next()
Move on to another
BleRead instance, based on the last one (so if you only need to change the char UUID, you don't have to set all
other fields again). |
B |
nextNew()
Move on to another
BleRead instance, with the new instance having no fields set. |
BleWrite.Builder |
setBoolean(boolean value)
Set the boolean to write.
|
BleWrite.Builder |
setBytes(byte[] data)
Set the raw bytes to write.
|
B |
setCharacteristicUUID(java.util.UUID uuid)
Set the characteristic UUID.
|
BleWrite.Builder |
setData(FutureData data)
Set the
FutureData to write. |
B |
setDescriptorFilter(DescriptorFilter filter)
Set the
DescriptorFilter to determine which characteristic to operate on, if there are multiple with the same UUID in the same
BluetoothGattService . |
BleWrite.Builder |
setInt(int val)
Set an int to be written.
|
BleWrite.Builder |
setIsBigEndian(boolean isBigEndian)
Tells SweetBlue the endianness of the BLE device you want to perform a write to.
|
BleWrite.Builder |
setLong(long val)
Set a long to be written.
|
B |
setReadWriteListener(ReadWriteListener listener)
Set the
ReadWriteListener for listening to the callback of the operation you wish to perform. |
B |
setServiceUUID(java.util.UUID uuid)
Set the service UUID for this operation.
|
BleWrite.Builder |
setShort(short val)
Set a short to be written.
|
BleWrite.Builder |
setString(java.lang.String value)
Set a string to be written.
|
BleWrite.Builder |
setString(java.lang.String value,
java.lang.String stringEncoding)
Set a string to be written.
|
BleWrite.Builder |
setWriteType(ReadWriteListener.Type writeType)
Set the
ReadWriteListener.Type of the write to perform. |
public Builder()
public Builder(java.util.UUID characteristicUuid)
public Builder(java.util.UUID serviceUuid, java.util.UUID characteristicUuid)
public final BleWrite.Builder setIsBigEndian(boolean isBigEndian)
setBoolean(boolean)
setInt(int)
setLong(long)
setShort(short)
setString(String)
setString(String, String)
public final BleWrite.Builder setWriteType(ReadWriteListener.Type writeType)
ReadWriteListener.Type
of the write to perform. This is here in the case that the
characteristic you are writing to has more than one write type associated with it eg. BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
,
BluetoothGattCharacteristic.WRITE_TYPE_SIGNED
along with standard writes.public final BleWrite.Builder setBytes(byte[] data)
public final BleWrite.Builder setData(FutureData data)
FutureData
to write.public final BleWrite.Builder setBoolean(boolean value)
public final BleWrite.Builder setInt(int val)
public final BleWrite.Builder setShort(short val)
public final BleWrite.Builder setLong(long val)
public final BleWrite.Builder setString(java.lang.String value, java.lang.String stringEncoding)
String.getBytes()
is used instead, which uses "UTF-8" by default.public final BleWrite.Builder setString(java.lang.String value)
public final BleWrite[] buildArray()
public final B setServiceUUID(java.util.UUID uuid)
public final B setCharacteristicUUID(java.util.UUID uuid)
public final B setReadWriteListener(ReadWriteListener listener)
ReadWriteListener
for listening to the callback of the operation you wish to perform.public final B setDescriptorFilter(DescriptorFilter filter)
DescriptorFilter
to determine which characteristic to operate on, if there are multiple with the same UUID
in the same
BluetoothGattService
.public final B next()
BleRead
instance, based on the last one (so if you only need to change the char UUID, you don't have to set all
other fields again).public final B nextNew()
BleRead
instance, with the new instance having no fields set.public final java.util.List<T> build()
BleRead
s.