forked from h2zero/esp-nimble-cpp
Replace semaphores with task notifications. (#9)
* Replace all semaphores with task notifications. * use critical sections to prevent concurrent data access. * Ensure scan stop has been called before connecting. * Optimize and cleanup * Add template casting to NimBLERemoteDescriptor::readValue() * Removed storage of the descriptor value read as it did not serve any purpose.
This commit is contained in:
+6
-12
@@ -22,17 +22,13 @@
|
||||
|
||||
#include "NimBLEAddress.h"
|
||||
#include "NimBLEUUID.h"
|
||||
#include "NimBLEUtils.h"
|
||||
#include "NimBLEAdvertisedDevice.h"
|
||||
#include "NimBLERemoteService.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
typedef struct {
|
||||
const NimBLEUUID *uuid;
|
||||
const void *attribute;
|
||||
} disc_filter_t;
|
||||
|
||||
class NimBLERemoteService;
|
||||
class NimBLEClientCallbacks;
|
||||
class NimBLEAdvertisedDevice;
|
||||
@@ -89,14 +85,12 @@ private:
|
||||
|
||||
NimBLEAddress m_peerAddress = NimBLEAddress("");
|
||||
uint16_t m_conn_id;
|
||||
bool m_isConnected = false;
|
||||
bool m_waitingToConnect =false;
|
||||
bool m_deleteCallbacks = true;
|
||||
bool m_isConnected;
|
||||
bool m_waitingToConnect;
|
||||
bool m_deleteCallbacks;
|
||||
int32_t m_connectTimeout;
|
||||
NimBLEClientCallbacks* m_pClientCallbacks = nullptr;
|
||||
FreeRTOS::Semaphore m_semaphoreOpenEvt = FreeRTOS::Semaphore("OpenEvt");
|
||||
FreeRTOS::Semaphore m_semaphoreSearchCmplEvt = FreeRTOS::Semaphore("SearchCmplEvt");
|
||||
FreeRTOS::Semaphore m_semeaphoreSecEvt = FreeRTOS::Semaphore("Security");
|
||||
NimBLEClientCallbacks* m_pClientCallbacks;
|
||||
ble_task_data_t *m_pTaskData;
|
||||
|
||||
std::vector<NimBLERemoteService*> m_servicesVector;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user