15 #ifndef COMPONENTS_NIMBLEREMOTESERVICE_H_
16 #define COMPONENTS_NIMBLEREMOTESERVICE_H_
19 #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
21 #include "NimBLEClient.h"
22 #include "NimBLEUUID.h"
23 #include "NimBLERemoteCharacteristic.h"
39 std::vector<NimBLERemoteCharacteristic*>::iterator
begin();
40 std::vector<NimBLERemoteCharacteristic*>::iterator
end();
50 const std::string &value);
63 bool retrieveCharacteristics(
const NimBLEUUID *uuid_filter =
nullptr);
64 static int characteristicDiscCB(uint16_t conn_handle,
65 const struct ble_gatt_error *error,
66 const struct ble_gatt_chr *chr,
69 uint16_t getStartHandle();
70 uint16_t getEndHandle();
71 void releaseSemaphores();
76 std::vector<NimBLERemoteCharacteristic*> m_characteristicVector;
80 uint16_t m_startHandle;
A model of a BLE client.
Definition: NimBLEClient.h:38
A model of a remote BLE characteristic.
Definition: NimBLERemoteCharacteristic.h:43
A model of a remote BLE service.
Definition: NimBLERemoteService.h:34
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:350
void deleteCharacteristics()
Delete the characteristics in the characteristics vector.
Definition: NimBLERemoteService.cpp:335
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:259
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:293
bool setValue(const NimBLEUUID &characteristicUuid, const std::string &value)
Set the value of a characteristic.
Definition: NimBLERemoteService.cpp:314
NimBLEUUID getUUID(void)
Get the service UUID.
Definition: NimBLERemoteService.cpp:283
std::string toString(void)
Create a string representation of this remote service.
Definition: NimBLERemoteService.cpp:371
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:37