Yes, I tried both :
wiced_sense.c From WICED-Smart-SDK-2.2.1 (using the installed SDK 2.2.1 of course)
wiced_sense.c From WICED_Sense_SDK 2.1_1.3Final (using the previous SDK)
for the one from the 2.2.1 SDK, the only difference is the OTA undefined, and its characteristic that gets dynamic length, I don't see much how that can influence our issue, but I tried nevertheless, and if not better, I would say maybe worse. I gave it more than five retries without beeing able to connect, while with the previous, I manage to connect almost every time what I press the phone connection and the tag wake at the same time.
How it looks like currently is that the wiced sense tag only accepts connection when requested very soon since the beginning of the broadcast, otherwise, the device become like deaf, only broadcasting advertising. For now I cannot say as Android is in the game as well.
I'll continue debugging this and provide more details when available.
I've been trying to replicate your issue on my GS6 running 5.1.1, however I have been able to connect to the wiced sense the first time using both the "Android workaround" and without the workaround.
However I do believe you are right in saying "the wiced sense tag only accepts connection when requested very soon." If you look at wiced_sense.c under the BLE_PROFILE_CFG, you are initially in NO_DISCOVERABLE (L320). Then in the wiced_sense_create, we call bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, wiced_sense_remote_addr) which starts high undirected advertisements which brings us back to our profile_cfg. The duration for this high undirected adv is 10 secs, advertising at an interval of 32 bt slots => 0.02 seconds. After 10 seconds, the device will then start low undirected adv for 10 secs at 1024 bt slots => 0.64 secs intervals. After those 20 seconds of advertising, your device will enter deep sleep based on wiced_sense_advertisement_stopped().
One thing that may help is to increase the duration of high undirected adv to something longer than 10 seconds.
Hi Kevin kwang,
I appreciate your investigation, it is taking us there, although there are still some other considerations:
- I will open another fork for one specific advertising issue I had, relative to the wiced sense.
I'm a new user, didn't found the "branch button" so here is the link:Why wiced sense advertising stop before completing durations ?
The advertisements that stops totally explain why the connection is only possible too early, I was talking about one to two seconds, I did multiple retries with increased duration to 30s+30s, that didn't help.
- I still would keep this question open, as one issue never comes alone, but I still do believe that even if wiced sense sends the right advertisements at the right time, Android still have difficulties to connect.
My next focus points regarding android will be to check if the connection request is sent, maybe too early or too late outside when the wiced sense is expecting it.