Commit 9be784f
authored
Improve cleanup in BLEClient (espressif#4742)
- 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 espressif#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 espressif#4047, espressif#4055
* Clear if after unregister espressif#40471 parent 7cdfb8b commit 9be784f
1 file changed
+30
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
131 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
163 | 184 | | |
164 | 185 | | |
165 | 186 | | |
| |||
184 | 205 | | |
185 | 206 | | |
186 | 207 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 208 | + | |
190 | 209 | | |
191 | 210 | | |
| 211 | + | |
192 | 212 | | |
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
196 | 219 | | |
197 | 220 | | |
198 | 221 | | |
| |||
228 | 251 | | |
229 | 252 | | |
230 | 253 | | |
231 | | - | |
| 254 | + | |
| 255 | + | |
232 | 256 | | |
233 | 257 | | |
234 | 258 | | |
| |||
0 commit comments