From bbaa9e5c5d2314440af042b1a515c982c8ca0f00 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 18 Sep 2021 18:36:22 +0200 Subject: Align Java/C++ findGatt[Service,Char](..) in BTDevice and BTGattService, remove obsolete entries in Java (w/ timeout parameter) --- api/direct_bt/BTDevice.hpp | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'api/direct_bt/BTDevice.hpp') diff --git a/api/direct_bt/BTDevice.hpp b/api/direct_bt/BTDevice.hpp index eecf0c1d..5a7a5f14 100644 --- a/api/direct_bt/BTDevice.hpp +++ b/api/direct_bt/BTDevice.hpp @@ -892,20 +892,37 @@ namespace direct_bt { *

*

* If this method has been called for the first time or no services has been detected yet, - * a list of GATTService will be discovered. + * a list of GATTService will be retrieved. *
- * In case no GATT connection has been established it will be created via connectGATT(). + * A GATT connection will be created via connectGATT() if not established yet. *

*/ jau::darray> getGattServices() noexcept; /** - * Returns the matching GATTService for the given uuid. - *

- * Implementation calls getGattService(). - *

+ * Find a BTGattService by its service_uuid. + * + * It will check objects for a connected device and caches them, using getGattService(). + * + * It will not turn on discovery or connect to devices. + * + * @parameter service_uuid the jau::uuid_t of the desired BTGattService + * @return The matching service or null if not found + */ + std::shared_ptr findGattService(const jau::uuid_t& service_uuid) noexcept; + + /** + * Find a BTGattChar by its service_uuid and char_uuid. + * + * It will check objects for a connected device and caches them, using getGattService(). + * + * It will not turn on discovery or connect to devices. + * + * @parameter service_uuid the jau::uuid_t of the intermediate BTGattService + * @parameter char_uuid the jau::uuid_t of the desired BTGattChar, within the intermediate BTGattService. + * @return The matching characteristic or null if not found */ - std::shared_ptr findGattService(const jau::uuid_t& uuid); + std::shared_ptr findGattChar(const jau::uuid_t& service_uuid, const jau::uuid_t& char_uuid) noexcept; /** Returns the shared GenericAccess instance, retrieved by {@link #getGattService()} or nullptr if not available. */ std::shared_ptr getGattGenericAccess(); -- cgit v1.2.3