• E
    Improve cleanup in BLEClient (#4742) · 9be784f6
    Emanuel Posescu 提交于
    - Remove client from the list of devices in case registration fails
    - Filter other events not related to registration during registration phase
    - Cleanup if connect fails
    - Reset if after disconnect
    - Disconnect callback *after* cleanup is done so object can be deleted
    
    This fixes some of the issues I had like:
    - `BLEClient::connect` hangs up and never recovered because registration failed
    - `BLEClient` could not be deleted after disconnect or deletion creating ghost events https://github.com/espressif/arduino-esp32/issues/4047
    - `BLEClient` could not be properly reused after a connection was attempted (successful or not) 
    
    * Cleanup in case of registration and connect failure.
    Cleanup before calling disconnect callback for safe delete.
    Reject other events during registration.
    Adresses #4047, #4055
    
    * Clear if after unregister #4047
    9be784f6
BLEClient.cpp 16.9 KB