I am using "ble_app_hrs_rscs_relay" example and modified it a bit by adding NUS service and FDS. Everything is working fine with mobile app and nrf dongle. How ever when I tired to connect it to "Bluetooth LE Explorer" in windows 10 it give me the below error.
I have written the code in a way that when ever the devices is connected its LED turns on. So once I connect to the hardware with the "Bluetooth LE Explorer" in windows the LED turns on and stays on which means that the connection is made but it never turns off even when I turn off the bluetooth of windows, infact I tried to disable the bluetooth device driver from device manager but still the LED is on. So I tried to restart my PC in case there is a driver issue but still it seems like the connection is still made.
Also note that mean while this I also checked if the device is advertising in case there is something wrong with the LED function(which is straight forward, turning on on connection event and turning off on disconnection event).
To resolve this state I have to give power cycle to the hardware.
My question is, Is this happening with all the examples of NRF or is this with only this one? Is NRF not compatible with windows bluetooth LE drivers?
Does your application support bonding (e.g. use peer manager)?
It may be a good idea (based on your current description) that you for instance start a timer on connected event, and if for instance the peer does not successfully bond or enable notifications within for instance 3-5seconds, then the application could call disconnect and start advertising again.
An on-air sniffer log would help tremendously to understand where it is failing (e.g nRF Sniffer).
Yes my application supports bonding. below if the screen shot of peep_manager_init
I implemented your suggestion to disconnect if the notification is not enabled. Its working fine with the NRF dongle how ever I tried to connect from the windows again and having the same issue, luckily have debug turn on, this is what I am getting from the logs
at the line 838 I have this under "ble_evt_handler"
What seems to be the problem here?
This event should already be handled by the peer manager, I suggest to comment it out.
Thanks. It worked after commenting it out.