0

I'm trying to create a GATT service on Windows 10 IoT, which requires the Low Energy Peripheral Role (LEPR). We tried on Windows 10 IoT Enterprise 2019 and it works, but it fails in Windows 10 IoT Enterprise 2016.

In Win10 IoT 2016, in device manager, the BT driver details doesn't even list the property Supports Low Energy Peripheral Role.

The property can also be checked using C# this code:

var localAdapter = await BluetoothAdapter.GetDefaultAsync();
ThrowIfNullAdapter(localAdapter);

if (!localAdapter.IsPeripheralRoleSupported)
{
    throw new Exception("Adapter does not support peripheral role");
}

These bluetooth APIs don't seem to be supported in Win10 IoT 2016, as I get a runtime error:

Requested Windows Runtime type 'Windows.Devices.Bluetooth.BluetoothAdapter' is not registered.

I would like to know if there is any way to use this role in Win10 IoT 2016? Is there a newer MS or 3rd party driver that can be installed? Or is there any other way to create a GATT server on this OS, such as another API provided by 3rd party library such as BTFramework, etc?

CSDev
  • 3,177
  • 6
  • 19
  • 37
  • I do not know what hardware your use but on Raspberry Pi 3 it works without any problem. You can check by running GattServer demo from Bluetooth Framework (https://www.btframework.com/bluetoothframework.htm). Copy compiled demo to your device, connect to it using SSH and simple run the demo. – Mike Petrichenko Jul 25 '19 at 19:56
  • Are you sure you have it working using 2016? And do you see the property in device manager for Peripheral Role? It is clearly there when we install 2019, but not in 2016. Also, does your demo use the .NET Bluetooth APIs I reference in my post? I'm using: using Windows.Devices.Bluetooth; using Windows.Devices.Bluetooth.GenericAttributeProfile; – ososnilknarf Jul 25 '19 at 21:54
  • Also, thank your for your reply, I will try the demo you link to and report back. – ososnilknarf Jul 25 '19 at 21:55
  • Unfortunately I have no IoT Enterprise (and have no device for that). I tested it on Windows 10 IoT Core that can be installed on Raspberry Pi. I think the problem you are facing is because there is no API for GATT Server (it requires Win 10 build 15063 and above, all Win 10 has identical APIs build, so this build number is also valid for WIn 10 IoT). And yes, the lib uses the same WinRT API. [Here](https://github.com/btframework/WclWinVer) you can find a code that shows how to detect Win version in right way. – Mike Petrichenko Jul 25 '19 at 22:23
  • By the way, you can try to use BlueSoleil Bluetooth drivers (if you run on x86 or x64). It supports GATT server as well (on any Windows platforms). – Mike Petrichenko Jul 25 '19 at 22:27
  • Mike, do you know where to find a link to download the BlueSoleil Bluetooth drivers? I'm navigating their website and can't find anywhere to download it to try before buying. – ososnilknarf Jul 25 '19 at 23:17
  • Here it is: http://www.bluesoleil.com/products/S0001201005190001.html – Mike Petrichenko Jul 26 '19 at 04:58
  • Yes, you are right the version of Windows is prior to build 15063. I guess there is no way to install support for the .NET API on this older OS? So it seems that the BlueSoleil driver won't solve that problem anyway, so maybe not necessary, since I'll have to use some other API on this older OS version. – ososnilknarf Jul 26 '19 at 21:08
  • No sure what you mean by "NET API" but BlueSoleil doe snot need any NET API. Any way, is there any way to update your OS for the latest build? If no, there is other very good Bluetooth stack (http://bluekitchen-gmbh.com/) (https://github.com/bluekitchen/btstack). It uses libusb (winusb) so can work with absolutely any USB Bluetooth dongle in user mode. Probably that helps you. – Mike Petrichenko Jul 27 '19 at 20:22
  • What I meant by .NET API was that the API I'm using to develop a GATT server is the methods I mentioned in my original post, and the APIs documented here: https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/gatt-server That is what I was wondering, if there was a run-time that can be installed on older OS to support those APIs. But if not, then I guess I'm not going to be able to use those APIs and I'll need to use some other method. Is that what BTFramework would provide? I'd like to upgrade to the newer OS as it would solve my problem, but we have challenges to doing that. – ososnilknarf Jul 29 '19 at 13:47
  • I see. Each Bluetooth stack has own API. And only mS is compatible with that .NET (actually WinRT) API. – Mike Petrichenko Jul 29 '19 at 13:49
  • I see. I apologize for the confusion about .NET API, I sometimes use the terms C# and .NET interchangeably, but I should be more accurate. So, would BTFramework provide a C# API for creating a GATT service, using only the MS driver included in the Windows IoT 2016? – ososnilknarf Jul 29 '19 at 14:36
  • Its not a problem with ".NET API", I just wanted to be sure I understood what you meant. Current BTF release supports only MS drivers (becasue that was first GATT server implementation and our customers use MS at this stange). However in next release it will also support BlueSoleil (We are planning to release it in about 2 weeks). – Mike Petrichenko Jul 29 '19 at 15:29

0 Answers0