app/bttester: do not send L2CAP disconnection event if error in connect

There is a little need of sending such event: created connection is
confirmed connection event; if no such event is received, the connection
can be considered not established. Disconnected event shall be sent only
for disconnection.

By removing disconnected_cb call on connect error we avoid calling it
for not established channel, for example when DCID in connection
response was a duplicate of already connected one. This would trigger
the assert `assert(channel != NULL);`.
This commit is contained in:
Krzysztof Kopyściński
2021-12-10 10:23:18 +01:00
committed by Krzysztof Kopyściński
parent d7c18041d7
commit 5b6352364b
-2
View File
@@ -259,8 +259,6 @@ tester_l2cap_event(struct ble_l2cap_event *event, void *arg)
if (event->connect.status) {
console_printf("LE COC error: %d\n", event->connect.status);
disconnected_cb(event->connect.conn_handle,
event->connect.chan, &chan_info, arg);
return 0;
}