Skip to content

Commit bc8da03

Browse files
committed
change(RemoteChar): Cleanup descriptorDiscCB
1 parent e4065d0 commit bc8da03

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/NimBLERemoteCharacteristic.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ int NimBLERemoteCharacteristic::descriptorDiscCB(
6767
int rc = error->status;
6868
NIMBLE_LOGD(LOG_TAG, "Descriptor Discovery >> status: %d handle: %d", rc, (rc == 0) ? dsc->handle : -1);
6969

70-
auto filter = (desc_filter_t*)arg;
71-
auto pTaskData = (NimBLETaskData*)filter->task_data;
72-
const auto pChr = (NimBLERemoteCharacteristic*)pTaskData->m_pInstance;
73-
const NimBLEUUID* uuidFilter = filter->uuid;
70+
auto filter = (desc_filter_t*)arg;
71+
auto pTaskData = (NimBLETaskData*)filter->task_data;
72+
const auto pChr = (NimBLERemoteCharacteristic*)pTaskData->m_pInstance;
73+
const auto uuid = filter->uuid; // UUID to filter for
7474

7575
if (pChr->getHandle() != chrHandle) {
7676
return 0; // Descriptor not for this characteristic
7777
}
78-
// Return early if not the descriptor we are looking for if filter exists.
79-
if (rc != 0 || (uuidFilter && ble_uuid_cmp(uuidFilter->getBase(), &dsc->uuid.u))) {
78+
// Return early if not the descriptor we are looking for if filter exists
79+
if (rc != 0 || (uuid && ble_uuid_cmp(uuid->getBase(), &dsc->uuid.u))) {
8080
goto Done;
8181
}
8282

83-
rc = !!uuidFilter * BLE_HS_EDONE; // If found the descriptor, stop the search
83+
rc = !!uuid * BLE_HS_EDONE; // If found the descriptor, stop the search
8484
pChr->m_vDescriptors.push_back(new NimBLERemoteDescriptor(pChr, dsc));
8585

8686
Done:

0 commit comments

Comments
 (0)