Use NimBLE calls for critical sections

This commit is contained in:
h2zero
2021-12-29 08:10:57 -07:00
parent 8620092c90
commit 9debfcd226
7 changed files with 21 additions and 27 deletions

View File

@@ -948,11 +948,11 @@ uint16_t NimBLEClient::getMTU() {
(*characteristic)->toString().c_str());
time_t t = time(nullptr);
portENTER_CRITICAL(&(*characteristic)->m_valMux);
ble_npl_hw_enter_critical();
(*characteristic)->m_value = std::string((char *)event->notify_rx.om->om_data,
event->notify_rx.om->om_len);
(*characteristic)->m_timestamp = t;
portEXIT_CRITICAL(&(*characteristic)->m_valMux);
ble_npl_hw_exit_critical(0);
if ((*characteristic)->m_notifyCallback != nullptr) {
NIMBLE_LOGD(LOG_TAG, "Invoking callback for notification on characteristic %s",