Not sure if you have done this already, but Android 6 requires location permission for BLE scanning. So, check if it has been enabled.
Can you tell me which phone you are using?
Hi Dheeraj, Thank you for the help!
It is actually an Android "Head Unit" for vehicles, that's why the version is so old... It also happens on some older tablets, I have a tablet that should be here shortly to test that has the same issue.
It is not a permission problem, location permissions are enabled. It seems to be related to Android 6.0.1 sending LL packets in the wrong order or not waiting for a response... see the screen captures below of a WireShark sniff session, can someone validate this?
When I connect with an iPhone I get "LL_VERSION_IND" from "Master -> Slave" and then from "Slave -> Master", followed by "LL_FEATURE_REQ / RSP", then the MTU exchange and the connection proceeds as expected.
However when I connect with Android 6.0.1 I get "LL_FEATURE_REQ / RSP" first then it is then followed by multiple "LL_FEATURE_REQ" from "Master -> Slave" WITHOUT a response from the "Slave / PSoC4". At this point the connection doesn't finish and just hangs... I get no more events, it seems to be a lock up in the PSoC stack.
BAD CONNECTION CAPTURE:
GOOD CONNECTION CAPTURE:
Based on the screenshots, looks like Android 6.0 Master is violating the spec. Before slave could send version-ind pdu, master is sending multiple version-ind pdu. According to spec device (both master or slave) can send version-ind pdu once during a connection.
"The link layer shall only queue for transmission a maximum of one LL_VERSION_IND PDU during a connection"
We will try to reproduce it on our end. Can you tell us which phone you are using?
We are having a similar issue, the device connects and immediately disconnects, Apple works fine, but all our Android devices are now failing to connect, after pairing.
Also, I have seen the BLE stack in a stopped state, and we do not have CyBle_Stop(); in our code at all. It takes a power reset to get it to come back.
We have a pretty basic implementation and the trouble started happening with the android recently.
Android will pair and work, stores bonding data, then we trying to reconnect it connects and then shows disconnect, and no reason given, and stops advertising.
This is on a Nokia Android 9, and a Samsung running Android 5.1.1
We are really stuck here, could there be a flaw in the BLE component? BLE 3.61