forked from h2zero/esp-nimble-cpp
Remove automatic discovery in NimBLEClient::connect().
Instead of discovering the peripheral database on connection and consuming the associated resources this will give the user more control over the discovery operation. * Adds void NimBLEClient::discoverAtrributes() for the user to discover all the peripheral attributes as a replacement for the former functionality. * getServices(), getCharacteristics(), getDescriptors() now take an optional bool parameter (default false). If true it will clear the respective vector and retrieve all the respective attributes from the peripheral. If false it will retrieve the attributes only if the vector is empty, otherwise the vector is returned with the currently stored attributes. * getService(NimBLEUUID), getCharacteristic(NimBLEUUID), getDescriptor(NimBLEUUID) will now check the respective vectors for the attribute object and, if not found, will retrieve (only) the specified attribute from the peripheral.
This commit is contained in:
@@ -29,7 +29,7 @@ static const char* LOG_TAG = "NimBLERemoteDescriptor";
|
||||
* @param [in] Reference to the struct that contains the descriptor information.
|
||||
*/
|
||||
NimBLERemoteDescriptor::NimBLERemoteDescriptor(NimBLERemoteCharacteristic* pRemoteCharacteristic,
|
||||
const struct ble_gatt_dsc *dsc)
|
||||
const struct ble_gatt_dsc *dsc)
|
||||
{
|
||||
switch (dsc->uuid.u.type) {
|
||||
case BLE_UUID_TYPE_16:
|
||||
|
||||
Reference in New Issue
Block a user