Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I need to write an application on Windows 10 desktop, to test and develop some embedded products with BLE. I know that BLE is more mature on iOS and Android (and even on Windows Phone), but we are used to Windows Desktop applications, developed in Visual Studio 2015, in c#.

I already developed with Windows 8.1 using a reference to WinRT runtime, to link the Bluetooth library in that framework.

Fron an initial overview, it seems that Windows 10 build 1511 has introduced some BLE improvements, for example pair/unpair from app.

But... how to access this new BLE APIs?
Windows 10 introduced the new Universal Windows Platform, the successot of Windows 8.1 WinRT.

Is there any chance to develop a winform or WPF application using the new APIs?
I tried this route, I managed to link the new APIs, but I stoppen on this error:

C#
error CS1545: Property, indexer, or event 'BluetoothLEAdvertisementWatcher.Received' is not supported by the language; try directly calling accessor methods 'BluetoothLEAdvertisementWatcher.add_Received(TypedEventHandler<BluetoothLEAdvertisementWatcher, BluetoothLEAdvertisementReceivedEventArgs>)' or 'BluetoothLEAdvertisementWatcher.remove_Received(EventRegistrationToken)'


The code is prettty basic:

_bluetoothLEAdvertisemenetWatcher = new BluetoothLEAdvertisementWatcher();
_bluetoothLEAdvertisemenetWatcher.Received += OnAdvertisemenetReceivedAsync;


Or should I follow the way of an UWP application?

Thanks!
Posted
Updated 10-Apr-16 20:30pm
v2

1 solution

Update: I found the way to include the Windows 10 runtime.

Add a reference to
C#
C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd


Thanks the same :-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900