aboutsummaryrefslogtreecommitdiffstats
path: root/java/org
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-01-24 19:35:54 +0100
committerSven Gothel <[email protected]>2022-01-24 19:35:54 +0100
commit2a7c32136cd0eb38647ab3cd107372009efefaa2 (patch)
tree41ae6981fdcceb92d4a07c6abd73d7fff0460bf9 /java/org
parent62ecc0a7619504678c7036e14919ee8c732f50a5 (diff)
Add DBGattServer::Listener::write[Char|Desc]ValueDone() (C++/Java), notifyies completion of single or bulk writeCharValue() ..
BTGattHandler maintains a handle list 'writeDataQueueHandles', grouping all queued writes (PREPARE_WRITE_REQ). Final EXECUTE_WRITE_REQ will issue one applyWrite(..) per queued write-req. If all were successful (accepted and performed), one signalWriteDone() will be issued per handle. This allows the user to react on a completed write-queue having the full data set available. +++
Diffstat (limited to 'java/org')
-rw-r--r--java/org/direct_bt/DBGattServer.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/org/direct_bt/DBGattServer.java b/java/org/direct_bt/DBGattServer.java
index d625e7eb..e4001198 100644
--- a/java/org/direct_bt/DBGattServer.java
+++ b/java/org/direct_bt/DBGattServer.java
@@ -142,10 +142,21 @@ public final class DBGattServer implements AutoCloseable
* @param value
* @param value_offset
* @return true if master write has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the write action will be allowed.
+ * @see #writeCharValueDone(BTDevice, DBGattService, DBGattChar)
*/
public abstract boolean writeCharValue(final BTDevice device, final DBGattService s, final DBGattChar c, final byte[] value, final int value_offset);
/**
+ * Notifies completion of single or bulk {@link #writeCharValue(BTDevice, DBGattService, DBGattChar, byte[], int) writeCharValue()} after having accepted and performed all write requests.
+ *
+ * @param device
+ * @param s
+ * @param c
+ * @see #writeCharValue(BTDevice, DBGattService, DBGattChar, byte[], int)
+ */
+ public abstract void writeCharValueDone(final BTDevice device, final DBGattService s, final DBGattChar c);
+
+ /**
* Signals attempt to write a single or bulk (prepare) value.
*
* Callee shall accept the write request by returning true, otherwise false.
@@ -157,11 +168,23 @@ public final class DBGattServer implements AutoCloseable
* @param value
* @param value_offset
* @return true if master write has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the write action will be allowed.
+ * @see #writeDescValueDone(BTDevice, DBGattService, DBGattChar, DBGattDesc)
*/
public abstract boolean writeDescValue(final BTDevice device, final DBGattService s, final DBGattChar c, final DBGattDesc d,
final byte[] value, final int value_offset);
/**
+ * Notifies completion of single or bulk {@link #writeDescValue(BTDevice, DBGattService, DBGattChar, DBGattDesc, byte[], int) writeDescValue()} after having accepted and performed all write requests.
+ *
+ * @param device
+ * @param s
+ * @param c
+ * @param d
+ * @see #writeDescValue(BTDevice, DBGattService, DBGattChar, DBGattDesc, byte[], int)
+ */
+ public abstract void writeDescValueDone(final BTDevice device, final DBGattService s, final DBGattChar c, final DBGattDesc d);
+
+ /**
* Notifies a change of the Client Characteristic Configuration Descriptor (CCCD) value.
*
* @param device