18#ifndef NIMBLE_CPP_REMOTE_SERVICE_H_
19#define NIMBLE_CPP_REMOTE_SERVICE_H_
22#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
24# include "NimBLEAttribute.h"
44 uint16_t getStartHandle()
const {
return getHandle(); }
45 uint16_t getEndHandle()
const {
return m_endHandle; }
47 const std::vector<NimBLERemoteCharacteristic*>&
getCharacteristics(
bool refresh =
false)
const;
48 std::vector<NimBLERemoteCharacteristic*>::iterator
begin()
const;
49 std::vector<NimBLERemoteCharacteristic*>::iterator
end()
const;
56 bool retrieveCharacteristics(
const NimBLEUUID* uuidFilter =
nullptr)
const;
57 static int characteristicDiscCB(uint16_t conn_handle,
58 const struct ble_gatt_error* error,
59 const struct ble_gatt_chr* chr,
62 mutable std::vector<NimBLERemoteCharacteristic*> m_vChars{};
64 uint16_t m_endHandle{0};
A specialized container class to hold BLE attribute values.
Definition NimBLEAttValue.h:72
A base class for BLE attributes.
Definition NimBLEAttribute.h:29
uint16_t getHandle() const
Get the handle of the attribute.
Definition NimBLEAttribute.h:40
A model of a BLE client.
Definition NimBLEClient.h:49
A model of a remote BLE characteristic.
Definition NimBLERemoteCharacteristic.h:34
A model of a remote BLE service.
Definition NimBLERemoteService.h:34
bool setValue(const NimBLEUUID &characteristicUuid, const NimBLEAttValue &value) const
Set the value of a characteristic.
Definition NimBLERemoteService.cpp:244
NimBLEClient * getClient(void) const
Get the client associated with this service.
Definition NimBLERemoteService.cpp:220
std::string toString(void) const
Create a string representation of this remote service.
Definition NimBLERemoteService.cpp:287
std::vector< NimBLERemoteCharacteristic * >::iterator end() const
Get iterator to the end of the vector of remote characteristic pointers.
Definition NimBLERemoteService.cpp:59
const std::vector< NimBLERemoteCharacteristic * > & getCharacteristics(bool refresh=false) const
Get a pointer to the vector of found characteristics.
Definition NimBLERemoteService.cpp:133
void deleteCharacteristics() const
Delete the characteristics in the characteristics vector.
Definition NimBLERemoteService.cpp:259
size_t deleteCharacteristic(const NimBLEUUID &uuid) const
Delete characteristic by UUID.
Definition NimBLERemoteService.cpp:271
std::vector< NimBLERemoteCharacteristic * >::iterator begin() const
Get iterator to the beginning of the vector of remote characteristic pointers.
Definition NimBLERemoteService.cpp:51
NimBLEAttValue getValue(const NimBLEUUID &characteristicUuid) const
Read the value of a characteristic associated with this service.
Definition NimBLERemoteService.cpp:229
NimBLERemoteCharacteristic * getCharacteristic(const char *uuid) const
Get the remote characteristic object for the characteristic UUID.
Definition NimBLERemoteService.cpp:68
A model of a BLE UUID.
Definition NimBLEUUID.h:41