Michael wrote me privately:
Can I only filter the MAC address of the bluetooth? not the bluetooth name i.e. "01:23:45:67:89:10 Arduino" . I only want to dEtect dEvice with a name of "Arduino"
The BluetoothClient.AddressAndNames method returns a list of all BT devices you've ever paired with, and their BT MAC addresses.
Each item in the list is a text string containing the BT device's MAC address followed by its display name. The first seventeen characters of the string are the MAC address -- e.g. the 01:23:45:67:89:10 in your example -- and then the string continues with the display name -- e.g., " Arduino".
You could write some code to walk through this list, and find a device named "Arduino," and then return its MAC address.
See below for some sample code. A couple of notes on the code:
(1) the "contains text" function is case-sensitive, so if your device is called "arduino", it won't find it with "Arduino". (You could change the match term to "rduino" :)
(2) if there is more than one thing called Arduino, this code will only return the last one.
Fred
PS Michael please post any followups to the main group, not me privately.
