diff --git a/src/BLECharacteristic.cpp b/src/BLECharacteristic.cpp index 6db7b72e..956f74d9 100644 --- a/src/BLECharacteristic.cpp +++ b/src/BLECharacteristic.cpp @@ -383,7 +383,7 @@ bool BLECharacteristic::hasDescriptor(const char* uuid, int index) const for (int i = 0; i < numDescriptors; i++) { BLERemoteDescriptor* d = _remote->descriptor(i); - if (strcmp(uuid, d->uuid()) == 0) { + if (strcasecmp(uuid, d->uuid()) == 0) { if (count == index) { return true; } @@ -419,7 +419,7 @@ BLEDescriptor BLECharacteristic::descriptor(const char * uuid, int index) const for (int i = 0; i < numDescriptors; i++) { BLERemoteDescriptor* d = _remote->descriptor(i); - if (strcmp(uuid, d->uuid()) == 0) { + if (strcasecmp(uuid, d->uuid()) == 0) { if (count == index) { return BLEDescriptor(d); } diff --git a/src/BLEDevice.cpp b/src/BLEDevice.cpp index a74c1d9c..fa806104 100644 --- a/src/BLEDevice.cpp +++ b/src/BLEDevice.cpp @@ -310,7 +310,7 @@ bool BLEDevice::hasService(const char* uuid, int index) const for (int i = 0; i < numServices; i++) { BLERemoteService* s = device->service(i); - if (strcmp(uuid, s->uuid()) == 0) { + if (strcasecmp(uuid, s->uuid()) == 0) { if (count == index) { return true; } @@ -352,7 +352,7 @@ BLEService BLEDevice::service(const char * uuid, int index) const for (int i = 0; i < numServices; i++) { BLERemoteService* s = device->service(i); - if (strcmp(uuid, s->uuid()) == 0) { + if (strcasecmp(uuid, s->uuid()) == 0) { if (count == index) { return BLEService(s); } @@ -405,7 +405,7 @@ bool BLEDevice::hasCharacteristic(const char* uuid, int index) const BLERemoteCharacteristic* c = s->characteristic(j); - if (strcmp(c->uuid(), uuid) == 0) { + if (strcasecmp(c->uuid(), uuid) == 0) { if (count == index) { return true; } @@ -468,7 +468,7 @@ BLECharacteristic BLEDevice::characteristic(const char * uuid, int index) const for (int j = 0; j < numCharacteristics; j++) { BLERemoteCharacteristic* c = s->characteristic(j); - if (strcmp(c->uuid(), uuid) == 0) { + if (strcasecmp(c->uuid(), uuid) == 0) { if (count == index) { return BLECharacteristic(c); diff --git a/src/BLEService.cpp b/src/BLEService.cpp index 7f80663a..7b5df148 100644 --- a/src/BLEService.cpp +++ b/src/BLEService.cpp @@ -122,7 +122,7 @@ bool BLEService::hasCharacteristic(const char* uuid, int index) const for (int i = 0; i < numCharacteristics; i++) { BLERemoteCharacteristic* c = _remote->characteristic(i); - if (strcmp(uuid, c->uuid()) == 0) { + if (strcasecmp(uuid, c->uuid()) == 0) { if (count == index) { return true; } @@ -158,7 +158,7 @@ BLECharacteristic BLEService::characteristic(const char * uuid, int index) const for (int i = 0; i < numCharacteristics; i++) { BLERemoteCharacteristic* c = _remote->characteristic(i); - if (strcmp(uuid, c->uuid()) == 0) { + if (strcasecmp(uuid, c->uuid()) == 0) { if (count == index) { return BLECharacteristic(c); } diff --git a/src/utility/ATT.cpp b/src/utility/ATT.cpp index d46b2e2f..dfa0838a 100644 --- a/src/utility/ATT.cpp +++ b/src/utility/ATT.cpp @@ -193,7 +193,7 @@ bool ATTClass::discoverAttributes(uint8_t peerBdaddrType, uint8_t peerBdaddr[6], for (int i = 0; i < serviceCount; i++) { BLERemoteService* service = device->service(i); - if (strcmp(service->uuid(), serviceUuidFilter) == 0) { + if (strcasecmp(service->uuid(), serviceUuidFilter) == 0) { // found an existing service with same UUID return true; } diff --git a/src/utility/GAP.cpp b/src/utility/GAP.cpp index 78b1556e..e4ab45f9 100644 --- a/src/utility/GAP.cpp +++ b/src/utility/GAP.cpp @@ -328,11 +328,11 @@ void GAPClass::handleLeAdvertisingReport(uint8_t type, uint8_t addressType, uint bool GAPClass::matchesScanFilter(const BLEDevice& device) { - if (_scanAddressFilter.length() > 0 && _scanAddressFilter != device.address()) { + if (_scanAddressFilter.length() > 0 && !(_scanAddressFilter.equalsIgnoreCase(device.address()))) { return false; // drop doesn't match } else if (_scanNameFilter.length() > 0 && _scanNameFilter != device.localName()) { return false; // drop doesn't match - } else if (_scanUuidFilter.length() > 0 && _scanUuidFilter != device.advertisedServiceUuid()) { + } else if (_scanUuidFilter.length() > 0 && !(_scanUuidFilter.equalsIgnoreCase(device.advertisedServiceUuid()))) { return false; // drop doesn't match }