diff --git a/ESPBMS.ino b/ESPBMS.ino index f2cfdf6..292a4a8 100644 --- a/ESPBMS.ino +++ b/ESPBMS.ino @@ -31,7 +31,16 @@ void setup() { std::map* pChars = pRemoteService->getCharacteristics(); for (auto &myChar : *pChars) { String properties = getCharacteristicProperties(myChar.second); - Serial.println("\tCharacteristic: " + String(myChar.first.c_str()) + " | Properties: " + properties); + Serial.print("\tCharacteristic: " + String(myChar.first.c_str()) + " | Properties: " + properties); + + // Read descriptors of the characteristic + std::map* pDescs = myChar.second->getDescriptors(); + for (auto &desc : *pDescs) { + std::string descValue = desc.second->readValue(); + Serial.print(" | Descriptor: " + String(desc.first.c_str()) + " Value: " + String(descValue.c_str())); + } + + Serial.println(); } } pClient->disconnect(); @@ -48,8 +57,8 @@ String getCharacteristicProperties(BLERemoteCharacteristic* pChar) { if (pChar->canWriteNoResponse()) propDesc += "write_no_resp "; if (pChar->canNotify()) propDesc += "notify "; if (pChar->canIndicate()) propDesc += "indicate "; - propDesc.trim(); // This modifies propDesc in place - return propDesc; // Return the modified string + propDesc.trim(); + return propDesc; } void loop() {