diff --git a/lib/ble/tests/test_ble_transport.c b/lib/ble/tests/test_ble_transport.c index c5bd09f1..e34d4894 100644 --- a/lib/ble/tests/test_ble_transport.c +++ b/lib/ble/tests/test_ble_transport.c @@ -71,6 +71,8 @@ static void run(void* arg) { } if (!f->len) { f->len = 1; ble_backend_opened(b->owner, f->id, mtu); } if (!f->pending || hold) continue; + struct fake_link* target = f->peer ? slot(f->peer, f->other) : NULL; + if (target && !target->len) { schedule(b); continue; } /* Удалённая подписка должна завершиться до доставки HELLO. */ ble_link_id id = f->id, other = f->other; struct ble_backend* peer = f->peer; uint8_t data[512]; size_t len = f->len; memcpy(data, f->data, len); f->pending = 0; diff --git a/tools/cgathui_common/tests/test_ble_etcp.c b/tools/cgathui_common/tests/test_ble_etcp.c index 21d6b8ad..f87e7f5c 100644 --- a/tools/cgathui_common/tests/test_ble_etcp.c +++ b/tools/cgathui_common/tests/test_ble_etcp.c @@ -75,6 +75,8 @@ static void run(void* arg) { struct fake_link* f = &b->links[i]; if (!f->id) continue; if (!f->len) { f->len = 1; ble_backend_opened(b->owner, f->id, mtu); } if (!f->pending || hold) continue; + struct fake_link* target = f->peer ? slot(f->peer, f->other) : NULL; + if (target && !target->len) { schedule(b); continue; } /* Не доставлять HELLO до удалённого opened. */ ble_link_id id = f->id, other = f->other; struct ble_backend* peer = f->peer; uint8_t data[512]; size_t len = f->len; memcpy(data, f->data, len); f->pending = 0;