mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
TransactionBuilder: simplify the writing of single byte values
This commit is contained in:
committed by
José Rebelo
parent
8652471497
commit
956adf72d9
+1
-1
@@ -41,7 +41,7 @@ public class TransactionBuilder {
|
||||
mTransaction = new Transaction(taskName);
|
||||
}
|
||||
|
||||
public TransactionBuilder write(byte[] data) {
|
||||
public TransactionBuilder write(byte... data) {
|
||||
WriteAction action = new WriteAction(data);
|
||||
return add(action);
|
||||
}
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ public class TransactionBuilder {
|
||||
/// <li>no {@link BluetoothGatt#beginReliableWrite()} was used.</li>
|
||||
/// </ol>
|
||||
/// @see WriteAction
|
||||
public TransactionBuilder writeLegacy(BluetoothGattCharacteristic characteristic, byte[] data) {
|
||||
public TransactionBuilder writeLegacy(BluetoothGattCharacteristic characteristic, byte... data) {
|
||||
if (characteristic == null) {
|
||||
LOG.warn("Unable to write characteristic: null");
|
||||
return this;
|
||||
@@ -85,7 +85,7 @@ public class TransactionBuilder {
|
||||
}
|
||||
|
||||
/// @see WriteAction
|
||||
public TransactionBuilder write(BluetoothGattCharacteristic characteristic, byte[] data) {
|
||||
public TransactionBuilder write(BluetoothGattCharacteristic characteristic, byte... data) {
|
||||
if (characteristic == null) {
|
||||
LOG.warn("Unable to write characteristic: null");
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user