Improved attempts, still need encyption
This commit is contained in:
+5
-5
@@ -204,17 +204,17 @@ void BluettiBLE::onScanResult(BLEAdvertisedDevice advertisedDevice) {
|
||||
bool hasBluettiService = advertisedDevice.haveServiceUUID() &&
|
||||
advertisedDevice.isAdvertisingService(BLUETTI_SERVICE_UUID);
|
||||
|
||||
std::string nm = advertisedDevice.getName(); // hold a copy (c_str() of a
|
||||
// temporary would dangle)
|
||||
if (debugEnabled) {
|
||||
const char* nm = advertisedDevice.getName().c_str();
|
||||
Serial.printf("[BluettiBLE] seen: name='%s' rssi=%d bluetti=%s%s\n",
|
||||
(nm && nm[0]) ? nm : "(no name)",
|
||||
nm.empty() ? "(no name)" : nm.c_str(),
|
||||
advertisedDevice.getRSSI(),
|
||||
hasBluettiService ? "yes" : "no",
|
||||
(strcmp(nm, want) == 0) ? " <-- MATCHES" : "");
|
||||
(nm == want) ? " <-- MATCHES" : "");
|
||||
}
|
||||
|
||||
if (hasBluettiService &&
|
||||
strcmp(advertisedDevice.getName().c_str(), want) == 0) {
|
||||
if (hasBluettiService && nm == want) {
|
||||
if (foundDevice) delete foundDevice;
|
||||
foundDevice = new BLEAdvertisedDevice(advertisedDevice);
|
||||
devices[activeIndex].device.rssi = advertisedDevice.getRSSI();
|
||||
|
||||
Reference in New Issue
Block a user