BLE disconnect is not working properly

Hi @androidz

Thanks for the personalised update. Hmmm, ok. I think I can see where your problem is with your automated process.

It's a guess as I'm not to able to test but I would suggest you try inserting a "BluetoothLE1.StopScanning" method once you have found your match and make sure it is used before the "call BluetoothLE1.Connect" method and see if that makes a difference.

Hope that helps. Best of luck with your project.

3 Likes

Wow, it is working now.

But can you please explain how calling BluetoothLE1.StopScanning before calling BluetoothLE1.Connect.Index is making disconnect work.

Thank you

I do not know specifically, it's always done that way in examples as best practice (including in my sample template files).

... it's possible that another device is found and added to the address list, which will then potentially change the address indexes as the list is auto-sorted.

It is better that the code performs logically and is not continually running a function when it is no longer required, the App scan could clash with the Arduino send for example.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.