diff --git a/src/NimBLERemoteService.cpp b/src/NimBLERemoteService.cpp index c5fe0ff..94ca8de 100644 --- a/src/NimBLERemoteService.cpp +++ b/src/NimBLERemoteService.cpp @@ -35,7 +35,7 @@ static const char* LOG_TAG = "NimBLERemoteService"; * @param [in] service A pointer to the structure with the service information. */ NimBLERemoteService::NimBLERemoteService(NimBLEClient* pClient, const ble_gatt_svc* service) - : NimBLEAttribute{service->uuid, service->start_handle}, m_pClient{pClient}, m_endHandle{service->end_handle} {} + : NimBLEAttribute{NimBLEUUID(service->uuid), service->start_handle}, m_pClient{pClient}, m_endHandle{service->end_handle} {} /** * @brief When deleting the service make sure we delete all characteristics and descriptors. diff --git a/src/NimBLERemoteValueAttribute.h b/src/NimBLERemoteValueAttribute.h index c3a20e0..dfb2a70 100644 --- a/src/NimBLERemoteValueAttribute.h +++ b/src/NimBLERemoteValueAttribute.h @@ -186,7 +186,7 @@ class NimBLERemoteValueAttribute : public NimBLEAttribute { /** * @brief Construct a new NimBLERemoteValueAttribute object. */ - NimBLERemoteValueAttribute(const ble_uuid_any_t& uuid, uint16_t handle) : NimBLEAttribute(uuid, handle) {} + NimBLERemoteValueAttribute(const ble_uuid_any_t& uuid, uint16_t handle) : NimBLEAttribute(NimBLEUUID(uuid), handle) {} /** * @brief Destroy the NimBLERemoteValueAttribute object. diff --git a/src/NimBLEUUID.h b/src/NimBLEUUID.h index 346c6af..f754fe3 100644 --- a/src/NimBLEUUID.h +++ b/src/NimBLEUUID.h @@ -44,13 +44,13 @@ class NimBLEUUID { * @brief Created a blank UUID. */ NimBLEUUID() = default; - NimBLEUUID(const ble_uuid_any_t& uuid); NimBLEUUID(const uint8_t* pData, size_t size); NimBLEUUID(uint32_t first, uint16_t second, uint16_t third, uint64_t fourth); explicit NimBLEUUID(const std::string& uuid); explicit NimBLEUUID(uint16_t uuid); explicit NimBLEUUID(uint32_t uuid); explicit NimBLEUUID(const ble_uuid128_t* uuid); + explicit NimBLEUUID(const ble_uuid_any_t& uuid); uint8_t bitSize() const; const uint8_t* getValue() const;