Retrieve name of bluetooth device from rfcomm device services
<p>The context is the following, we have multiple trucks that contains a bluetooth to serial device, we have given each truck bluetooth a unique name to be able to connect to a specific truck. </p>

<p>I use this code to retrieve all the RFComm services  :</p>

<pre><code>DeviceInformation.FindAllAsync(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.SerialPort))
</code></pre>

<p>The problem is that all the DeviceInformation objects returned contains the name of the RFComm service in the Name property instead of the bluetooth device name. When my project was a Win 8 store app, all was fine since the name property contained the bluetooth device name.</p>

<p>I found that I could create a BluetoothDevice object using the device id returned by the above code, but then the app ask to use the bluetooth device for all devices until I find the good one. I would like to prevent that as it wasn't the case with Win 8 store app. </p>

<p>Second solution I found was to parse the device id of the RFComm service which look like this one </p>

<pre><code>Bluetooth#Bluetooth00:c2:c6:56:b0:61-00:15:be:0f:02:d7#RFCOMM:00000000:{00001101-0000-1000-8000-00805f9b34fb}
</code></pre>

<p>to remove everything past "#RFCOMM" and use the <code>DeviceInformation.CreateFromIdAsync()</code> function. This works but I was wondering if there was a cleaner solution to my problem since parsing a string can be a real problem if the string format change. </p>

<p>Is there a way to retrieve the name of the bluetooth device without having to ask to use all bluetooth device until we find it?</p>