aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-05-15 01:23:18 +0200
committerSven Gothel <[email protected]>2022-05-15 01:23:18 +0200
commit82ecfd8e19c88e3e4d0ddb04796874834292a05e (patch)
treea18d4972d9600521e2e830b0e541196d562e5066 /java
parent919cf46dd36e7c97a5784d86b5313f024212a756 (diff)
noexcept: BTGattHandler::send*(): Fix BTDevice::getGattService(): Return zero sized array of BTGattServices on error
BTGattHandler::discoverCompletePrimaryServices(): - just discover the services and its characteristics and descriptors - return bool, success of failor as returned by discovery methods (incl. their send*() command) BTGattHandler::initClientGatt(): - clear services before retrieval and on error - error response on - BTGattHandler::discoverCompletePrimaryServices() failure - no services - no GenericAccess services - only return true and leave services if no error BTDevice::getGattService(): - perform BTGattHandler::initClientGatt() error checks as well - update method API doc, describing failure included no GenericAccess service
Diffstat (limited to 'java')
-rw-r--r--java/org/direct_bt/BTDevice.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/java/org/direct_bt/BTDevice.java b/java/org/direct_bt/BTDevice.java
index efa640f0..57187d6b 100644
--- a/java/org/direct_bt/BTDevice.java
+++ b/java/org/direct_bt/BTDevice.java
@@ -628,20 +628,23 @@ public interface BTDevice extends BTObject
boolean isValid();
/**
- * Returns a list of shared BTGattService available on this device if successful,
- * otherwise returns an empty list if an error occurred.
- * <p>
+ * Returns a complete list of shared BTGattService available on this device,
+ * initially retrieved via GATT discovery.
+ *
+ * In case of transmission error, zero services or no GATT GenericAccess,
+ * method will return zero services indicating an error.
+ * In this case, user can assume that the connection is or will be disconnected.
+ *
* Method is only functional on a remote BTDevice in {@link BTRole#Slave}, a GATT server,
* i.e. the local BTAdapter acting as a {@link BTRole#Master} GATT client.
- * </p>
- * <p>
+ *
* The HCI connectLE(..) or connectBREDR(..) must be performed first, see {@link #connectDefault()}.
- * </p>
- * <p>
- * If this method has been called for the first time or no services have been detected yet:
+ *
+ * If this method has been called for the first time:
* - the client MTU exchange will be performed
- * - a list of GATTService will be retrieved
- * </p>
+ * - a complete list of BTGattService inclusive their BTGattChar and BTGattDesc will be retrieved
+ * - the GATT GenericAccess is extracted from the services.
+ *
* @since 2.4.0
*/
List<BTGattService> getGattServices();