diff options
author | Sven Gothel <[email protected]> | 2021-09-14 17:10:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-15 09:48:24 +0200 |
commit | 5cf888d7acf1b29709bdc25ba2901597f2d56e15 (patch) | |
tree | 741efdfec9860a3236a184ed06cdb0a3a4182c22 /api/direct_bt/BTDevice.hpp | |
parent | 3a58b0593ddc62e6f9c0a9e5b0a176282090507a (diff) |
uuid_t: static factory return unique_ptr<uuid_t> (drop const); Have uuid_t as pure virtual; Add clone() and put(..) member; ..
.. and use immutable `const uuid_t` on client side.
EInfoReport::addService(..): Add missing set(EIRDataType::SERVICE_UUID);
EInfoReport::read_data(..): Add `[[fallthrough]]` and add missing break in switch block.
Diffstat (limited to 'api/direct_bt/BTDevice.hpp')
-rw-r--r-- | api/direct_bt/BTDevice.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/api/direct_bt/BTDevice.hpp b/api/direct_bt/BTDevice.hpp index 3584beeb..2df60a5d 100644 --- a/api/direct_bt/BTDevice.hpp +++ b/api/direct_bt/BTDevice.hpp @@ -70,7 +70,7 @@ namespace direct_bt { jau::relaxed_atomic_uint16 hciConnHandle; jau::ordered_atomic<LE_Features, std::memory_order_relaxed> le_features; std::shared_ptr<ManufactureSpecificData> advMSD = nullptr; - jau::darray<std::shared_ptr<uuid_t>> advServices; + jau::darray<std::shared_ptr<const uuid_t>> advServices; #if SMP_SUPPORTED_BY_OS std::shared_ptr<SMPHandler> smpHandler = nullptr; std::recursive_mutex mtx_smpHandler; @@ -126,14 +126,14 @@ namespace direct_bt { } /** Add advertised service (GAP discovery) */ - bool addAdvService(std::shared_ptr<uuid_t> const &uuid) noexcept; + bool addAdvService(std::shared_ptr<const uuid_t> const &uuid) noexcept; /** Add advertised service (GAP discovery) */ - bool addAdvServices(jau::darray<std::shared_ptr<uuid_t>> const & services) noexcept; + bool addAdvServices(jau::darray<std::shared_ptr<const uuid_t>> const & services) noexcept; /** * Find advertised service (GAP discovery) index * @return index >= 0 if found, otherwise -1 */ - int findAdvService(std::shared_ptr<uuid_t> const &uuid) const noexcept; + int findAdvService(std::shared_ptr<const uuid_t> const &uuid) const noexcept; EIRDataType update(EInfoReport const & data) noexcept; EIRDataType update(GattGenericAccessSvc const &data, const uint64_t timestamp) noexcept; @@ -298,7 +298,7 @@ namespace direct_bt { * use {@link #getGattService()}. * </p> */ - jau::darray<std::shared_ptr<uuid_t>> getAdvertisedServices() const noexcept; + jau::darray<std::shared_ptr<const uuid_t>> getAdvertisedServices() const noexcept; std::string toString() const noexcept override { return toString(false); } |