Commit 3742221
committed
Fix BLE byte counter regression introduced in 9.0.0
In 8.0.0, addOnReceiveListener() called addOnReceiveCallback() which
registered callbacks in both _onReceiveListeners and the BLE-specific
_onCharateristicValueChangedListeners array. In 9.0.0 this was removed
to "avoid duplicate push", but Serial's addOnReceiveCallback() pushes
to _onReceiveListeners while BLE's pushes to its own separate array.
This meant the byte counter listener (added via addOnReceiveListener)
only went into _onReceiveListeners, but BLE's notification handler only
called _onCharateristicValueChangedListeners - so the counter never
incremented and MSP responses were never seen by the parser.
Fix: align BLE with Serial by using _onReceiveListeners throughout,
removing the now-unnecessary _onCharateristicValueChangedListeners array.
Includes debug logging to aid diagnosis if further issues arise.1 parent d7a1e84 commit 3742221
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 | | |
| 179 | + | |
| 180 | + | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
| |||
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
245 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
246 | 254 | | |
247 | 255 | | |
248 | 256 | | |
249 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
250 | 260 | | |
251 | 261 | | |
252 | 262 | | |
| |||
0 commit comments