Comments (4)
Fixed
from mynewt-nimble.
I looked a bit further and I think a client workaround seems unlikely, since this pretty much happens inside NimBLE.
In ble_l2cap_coc:492
it says
conn = ble_hs_conn_find_assert(chan->conn_handle);
rc = ble_l2cap_tx(conn, chan, txom);
if (rc) {
/* txom is consumed by l2cap */
txom = NULL;
goto failed;
} else {
tx->credits--;
tx->data_offset += len - sdu_size_offset;
}
ble_hs_conn_find_assert
is supposed to trigger an assertion in debug code, when the conn_handle
is nowhere to be found in the active connections. For production code, this (of course) doesn't happen -- but an assertion might be too much of a weapon here anyways. I suppose something along the lines of:
conn = ble_hs_conn_find_assert(chan->conn_handle);
if (!conn) { /* connection might have been dropped in the meantime */
goto failed;
}
rc = ble_l2cap_tx(conn, chan, txom);
if (rc) {
/* txom is consumed by l2cap */
txom = NULL;
goto failed;
} else {
tx->credits--;
tx->data_offset += len - sdu_size_offset;
}
This change helps in my tests. The upper layers then properly detect that send fails, but since it's during shutdown, they're silently ignored.
from mynewt-nimble.
Hi, could you please try applying this patch? #1766 And please let me know if this works
from mynewt-nimble.
@KKopyscinski This patch works very well. Instead of a crash, I get the expected -ENOTCONN
now.
E (9486) NimBLEL2CAPChannel: ble_l2cap_send failed: 7
Thanks!
from mynewt-nimble.
Related Issues (20)
- reserved identifier violation HOT 1
- Where can I find documentation for known vulnerabilities
- NimBLE supports to disable BLE GATT client or server HOT 1
- NimBLE sample build error with apache-mynewt-core HOT 1
- Broken Link HOT 1
- How to trace function calls in controller code
- Document NimBLE Vendor specific HCI commands and events
- Is it possible to run Nimble auto-pts on linux? HOT 1
- Reducing MSYS_1_BLOCK_SIZE breaks SC Pairing DH key exchange HOT 5
- nimble-linux: ble_hci_sock_init: Assertion `rc == 0' failed. HOT 4
- Ability for ble_gatts_notify_custom() to wait for new packet buffers
- Change Macro from min to MIN in lpn.c
- controller/iso: ISO broadcast support without encryption HOT 1
- Error code of ble_gap_adv_set_data function HOT 2
- Possibility to read IO capability of initiating device
- `ble_gatts_clt_cfg_access(...)` odd return values casted from `BLE_HS_E...` to `BLE_ATT_ERR_...` on storage overflow
- L2CAP COC: Removing a server HOT 7
- linux_blemesh example HOT 8
- npl/linux: Callout gets stuck in active state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mynewt-nimble.