diff options
author | Sven Gothel <[email protected]> | 2021-09-18 18:36:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-18 18:36:22 +0200 |
commit | bbaa9e5c5d2314440af042b1a515c982c8ca0f00 (patch) | |
tree | bfc0e3e3f53b1878f239b1669b8119977092b0cd /api/direct_bt/BTDevice.hpp | |
parent | 7b65703688949672815ad2deb43816e837329505 (diff) |
Align Java/C++ findGatt[Service,Char](..) in BTDevice and BTGattService, remove obsolete entries in Java (w/ timeout parameter)
Diffstat (limited to 'api/direct_bt/BTDevice.hpp')
-rw-r--r-- | api/direct_bt/BTDevice.hpp | 31 |
1 files changed, 24 insertions, 7 deletions
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 { * </p> * <p> * 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. * <br> - * 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. * </p> */ jau::darray<std::shared_ptr<BTGattService>> getGattServices() noexcept; /** - * Returns the matching GATTService for the given uuid. - * <p> - * Implementation calls getGattService(). - * </p> + * 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<BTGattService> 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<BTGattService> findGattService(const jau::uuid_t& uuid); + std::shared_ptr<BTGattChar> 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<GattGenericAccessSvc> getGattGenericAccess(); |