15 #ifndef COMPONENTS_NIMBLEREMOTESERVICE_H_
16 #define COMPONENTS_NIMBLEREMOTESERVICE_H_
17 #include "sdkconfig.h"
18 #if defined(CONFIG_BT_ENABLED)
21 #if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
23 #include "NimBLEClient.h"
24 #include "NimBLEUUID.h"
25 #include "NimBLERemoteCharacteristic.h"
41 std::vector<NimBLERemoteCharacteristic*>::iterator
begin();
42 std::vector<NimBLERemoteCharacteristic*>::iterator
end();
52 const std::string &value);
65 bool retrieveCharacteristics(
const NimBLEUUID *uuid_filter =
nullptr);
66 static int characteristicDiscCB(uint16_t conn_handle,
67 const struct ble_gatt_error *error,
68 const struct ble_gatt_chr *chr,
71 uint16_t getStartHandle();
72 uint16_t getEndHandle();
73 void releaseSemaphores();
78 std::vector<NimBLERemoteCharacteristic*> m_characteristicVector;
82 uint16_t m_startHandle;
A model of a BLE client.
Definition: NimBLEClient.h:41
A model of a remote BLE characteristic.
Definition: NimBLERemoteCharacteristic.h:45
A model of a remote BLE service.
Definition: NimBLERemoteService.h:36
std::vector< NimBLERemoteCharacteristic * >::iterator end()
Get iterator to the end of the vector of remote characteristic pointers.
Definition: NimBLERemoteService.cpp:76
size_t deleteCharacteristic(const NimBLEUUID &uuid)
Delete characteristic by UUID.
Definition: NimBLERemoteService.cpp:345
void deleteCharacteristics()
Delete the characteristics in the characteristics vector.
Definition: NimBLERemoteService.cpp:330
virtual ~NimBLERemoteService()
When deleting the service make sure we delete all characteristics and descriptors.
Definition: NimBLERemoteService.cpp:58
std::vector< NimBLERemoteCharacteristic * > * getCharacteristics(bool refresh=false)
Get a pointer to the vector of found characteristics.
Definition: NimBLERemoteService.cpp:135
NimBLEClient * getClient(void)
Get the client associated with this service.
Definition: NimBLERemoteService.cpp:254
std::vector< NimBLERemoteCharacteristic * >::iterator begin()
Get iterator to the beginning of the vector of remote characteristic pointers.
Definition: NimBLERemoteService.cpp:67
std::string getValue(const NimBLEUUID &characteristicUuid)
Read the value of a characteristic associated with this service.
Definition: NimBLERemoteService.cpp:288
bool setValue(const NimBLEUUID &characteristicUuid, const std::string &value)
Set the value of a characteristic.
Definition: NimBLERemoteService.cpp:309
NimBLEUUID getUUID(void)
Get the service UUID.
Definition: NimBLERemoteService.cpp:278
std::string toString(void)
Create a string representation of this remote service.
Definition: NimBLERemoteService.cpp:366
NimBLERemoteCharacteristic * getCharacteristic(const char *uuid)
Get the remote characteristic object for the characteristic UUID.
Definition: NimBLERemoteService.cpp:86
A model of a BLE UUID.
Definition: NimBLEUUID.h:31