I am using the stock Windows 10 UWP SDK sample BluetoothLE, to connect to a Microchip RN4870 BLE Transparent UART device, a BLE 5.0 certified module. On my initial development PC I was able to successfully Enumerate, Select, then Connect to the device. (and of course subscribe and communicate)
The problem is that this only works on certain machines. For example, on this Surface Pro 6, (latest Win updates same as the original dev PC) it Enumerates, but Fails to connect. Tried at least 4 other PCs, only 1 of the four connected. I took the Belkin 4.0 fob from a working machine, stuck it in the Surface, enabled it and it STILL fails... so not BT modem, not Win revision, same app. What else is even involved?
Where it fails is: Scenario2_Client.xaml.cs (line 132) GattDeviceServicesResult result = await bluetoothLeDevice.GetGattServicesAsync(BluetoothCacheMode.Uncached);
In the failed situation, it always returns Device Unreachable.
I'm not sure how to proceed. MS' SDK github guy says he wont debug issues with devices, yet offers no other support either. MS tech support told me to open a paid support case...
A lot of people use these devices so its probably something rather simple.
Things I tried:
- checked BT modem level across all machines. Result: 4 machines each with different rev's, 2 good machines with BT5.0 (intel), and BT4.0(belkin), while bad machines with BT4.2 (marvell), BT5.0 so no way to tie in the BT revision
- All devices pair fine. All devices work with the Droid sample app, and iOS sample apps. So the parts are fine, in fact they work on the initial PC so its a good modem.
Suspicious: On the good machine, the KnownDevice list shows the IsConnectable flag and it is flickering. Like its constantly changing. On the Surface it never does, or very rarely does. I have a feeling this is significant but there is so little documentation that I can make sense of.. idk what to do about it.
The RN4870 is a UART, so it echos what it gets. On the good machines it spits out this: %REBOOT%%CONNECT,0,982CBC6906B2%%SECURED% on the bad machines it spits out this: %CONNECT,0,F06E0BC5CE8B%%ERR_SEC%%DISCONNECT%
Hope that all helps you to help me, Thanks