- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Very often when trying to connect to a device, I get after several second a BTM_ENABLED_EVT with the status code 0x2 (timeout) and then a connection UP. What is really happening and how to prevent this ? It really slows down the connection time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This doesn't appear to be a timeout, but rather a BTM_BUSY error which can be thrown as a result of numerous different flags throughout the stack.
The BTM_ENABLED_EVT should only be thrown on initialization of the stack--after that this should not be called. If it is called multiple times you may be triggering the watchdog somewhere.
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes you are right, it is WICED_PENDING error code. I only initialise the stack once at the beginning of my program and get a BTM_ENABLED_EVT with status WICED_SUCCESS (0x00). It is only after some time after several connection/disconnection that I get this event when I try to connect to a device. I launch wiced_bt_gatt_le_connect and around 6-7 seconds later I receive a BTM_ENABLED_EVT event with error code WICED_PENDING (0x2) and around one second later I receive a connection UP event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're getting multiple BTM_ENABLED_EVT, it's very likely that you're rebooting in that 6-7 second gap. I can't say why this would be happening without taking a look at the code.
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got same 0x02 in BTM_ENABLED_EVT for restful_smart_server & bt_smartbridge demo in stock SDK-3.7.0.
Maybe jakewtorres could also take a look at their source code.
Platform : BCM94343W (SPIL N08 module)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would it be a stack overflow problem ? Something wrong in the BLE code ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm unable to replicate this so far. Still looking into it.
marmottus What value does your wiced_bt_gatt_le_connect function return? What hardware and what SDK are you using?
xavier@candyhouse Do you see the 0x02 status on the very first BTM_ENABLED_EVT or is it a later event like is happening to marmottus?
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Once I saw it on first BTM_ENABLED_EVT.
But now I can't reproduce it either...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Doesn't happen to me for now with 3.7.0