Simpler bluetooth connection method

This may have already been covered, but I searched for quite some time to no avail.
I'm interested in connecting my BT (HC-05) when the page initializes. Though I have accomplished that, my challenge is each BT module you get, it will have a different MAC. So... the one common thing is the "HC-05" at the end of the MAC. Is there a way to call that with coding like I remember when doing Visual Basic. For example.... "Contains" in string "HC-05"?
This app will be open source for a group but there is no way of aligning every app with every bluetooth. Does that make sense? Attached was my effort but it doesn't seem to work. If I type the MAC in it will

For a hint, AdresAndNames is a device list, not a text string.

1 Like

Gotcha, but what is? Would I have to somehow put the whole addressandname into another list, then query that list?

Try it:

First, the loop extracts each item in the list and looks for the name HC-05 in it. If it finds HC-05 in any item then it saves that item in the "address" variable and stops searching. Then the Bluetooth component connects to the BT module with the address from the variable "address".

All I can say is WOW, thank you so much! You saved me countless hours of banging my head, it worked like a champ. Attached is the block diagram and the full app.