0

I am using the following Class on a project that connects to a bluetooth device :

https://h2zero.github.io/esp-nimble-cpp/class_nim_b_l_e_remote_characteristic.html

I need to use the attribute getDescriptors(). According to the documentation above, it returns a pointer to a vector of pointers. I am trying to iterate through that vector.

My code is the following :

std::vector<NimBLERemoteDescriptor*> * pvDscs = nullptr;
std::vector<NimBLERemoteDescriptor*>::iterator it;

pvDscs = pChr->getDescriptors(true);

for (it = pvDscs->begin() ; it != pvDscs->end(); ++it) {
    printf("Handle : %d", (*it)->getHandle());
}

The code above doesn't generate any error, but the it seems the size of the vector is 0. I am not sure if that is because it is actually 0 or if I do not iterate well through the vector.

Any help appreciated if my code isn't correct.

Fredovsky
  • 387
  • 4
  • 16

0 Answers0