Make NimBLEUUID(const ble_uuid_any_t& uuid) explicit

This commit is contained in:
thekurtovic 2025-01-05 23:36:19 -05:00
parent f4eba218fc
commit c029c5fd4a
3 changed files with 3 additions and 3 deletions

View file

@ -35,7 +35,7 @@ static const char* LOG_TAG = "NimBLERemoteService";
* @param [in] service A pointer to the structure with the service information. * @param [in] service A pointer to the structure with the service information.
*/ */
NimBLERemoteService::NimBLERemoteService(NimBLEClient* pClient, const ble_gatt_svc* service) 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. * @brief When deleting the service make sure we delete all characteristics and descriptors.

View file

@ -186,7 +186,7 @@ class NimBLERemoteValueAttribute : public NimBLEAttribute {
/** /**
* @brief Construct a new NimBLERemoteValueAttribute object. * @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. * @brief Destroy the NimBLERemoteValueAttribute object.

View file

@ -44,13 +44,13 @@ class NimBLEUUID {
* @brief Created a blank UUID. * @brief Created a blank UUID.
*/ */
NimBLEUUID() = default; NimBLEUUID() = default;
NimBLEUUID(const ble_uuid_any_t& uuid);
NimBLEUUID(const uint8_t* pData, size_t size); NimBLEUUID(const uint8_t* pData, size_t size);
NimBLEUUID(uint32_t first, uint16_t second, uint16_t third, uint64_t fourth); NimBLEUUID(uint32_t first, uint16_t second, uint16_t third, uint64_t fourth);
explicit NimBLEUUID(const std::string& uuid); explicit NimBLEUUID(const std::string& uuid);
explicit NimBLEUUID(uint16_t uuid); explicit NimBLEUUID(uint16_t uuid);
explicit NimBLEUUID(uint32_t uuid); explicit NimBLEUUID(uint32_t uuid);
explicit NimBLEUUID(const ble_uuid128_t* uuid); explicit NimBLEUUID(const ble_uuid128_t* uuid);
explicit NimBLEUUID(const ble_uuid_any_t& uuid);
uint8_t bitSize() const; uint8_t bitSize() const;
const uint8_t* getValue() const; const uint8_t* getValue() const;