Remove client delay calls and check if task is valid before notifying.

This commit is contained in:
h2zero
2021-01-12 13:54:53 -07:00
parent 740f280664
commit 09ff0c3472
2 changed files with 5 additions and 4 deletions

View File

@@ -221,7 +221,6 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttibutes) {
if (!NimBLEDevice::getScan()->stop()) {
return false;
}
vTaskDelay(1 / portTICK_PERIOD_MS);
break;
case BLE_HS_EDONE:
@@ -1028,7 +1027,9 @@ uint16_t NimBLEClient::getMTU() {
if(client->m_pTaskData != nullptr) {
client->m_pTaskData->rc = rc;
xTaskNotifyGive(client->m_pTaskData->task);
if(client->m_pTaskData->task) {
xTaskNotifyGive(client->m_pTaskData->task);
}
client->m_pTaskData = nullptr;
}