aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-28 12:08:11 +0200
committerSven Gothel <[email protected]>2023-10-28 12:08:11 +0200
commitbe7bb35a3c1c908278bb732743a23c6d85a5f853 (patch)
treede37ff910c1c0e490f5590b3c259641ed4357cc4 /java
parent9fb8e4008d2ae0b1ef0dd7d428acc64ba8a8a7bf (diff)
DBGattServer/Value: Add convenience make[_gatt]() for initializer list (byte array)
Diffstat (limited to 'java')
-rw-r--r--java/org/direct_bt/DBGattValue.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/org/direct_bt/DBGattValue.java b/java/org/direct_bt/DBGattValue.java
index 211afe46..b695c5cd 100644
--- a/java/org/direct_bt/DBGattValue.java
+++ b/java/org/direct_bt/DBGattValue.java
@@ -71,6 +71,11 @@ public class DBGattValue
return new DBGattValue(p, capacity, true /* variable_length */);
}
+ /** Convenience {@link DBGattValue} ctor function. */
+ public static DBGattValue make(final byte[] p) {
+ return new DBGattValue(p, p.length);
+ }
+
/**
* Constructor
* @param value the data, which length defines the maximum writable fixed length if variable length is false.