Skip to content

Commit ca3074c

Browse files
dimonomidcesantabot
authored andcommitted
Use mgos_bt_gatts_send_indicate()
Instead of calling `esp_ble_gatts_send_indicate()` directly. CL: - Fix bluetooth support: subscribing to notifications resulted in a CL: crash PUBLISHED_FROM=69c736a4b573370d6392ce7b74dd18f3c27ab8ce
1 parent 02aa693 commit ca3074c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/esp32/esp32_bt_gatts.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ static void gatts_ev_mgos(void *arg) {
244244
* event.
245245
*/
246246
struct ind_pending *indp = STAILQ_FIRST(&s_inds_pending);
247+
if (indp == NULL) {
248+
/*
249+
* Unsolicited CONF event; one reason to get it is to use
250+
* esp_ble_gatts_send_indicate() instead of
251+
* mgos_bt_gatts_send_indicate(), but there are other weird cases;
252+
* e.g. see this:
253+
* https://github.com/cesanta/dev/blob/aa17ba60f16119f8b10658304ee6e612ba223d75/mos_libs/uart-bridge/src/bt_svc/bt_svc_esp32.c#L185
254+
*/
255+
break;
256+
}
247257
STAILQ_REMOVE_HEAD(&s_inds_pending, next);
248258

249259
/*

0 commit comments

Comments
 (0)