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.
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.