c#


Connecting to bluetooth device using BluetoothLEDevice.FromIdAsync results in errors


I am building an app for the hololens using Unity. I want to connect to a bluetooth device. I started building a plugin in Visual Studio which I could call from my Unity project to find and connect to a device using bluetooth.
I used the documentation of Microsoft regarding this project: https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/gatt-client
The query for nearby devices works like a charm. Upon calling this function the events are properly launched when a device is found or removed. But when trying to create the function to connect to a device using the BluetootLEDevice.FromIdAsync() I get the following error:
ErrorCS4036'IAsyncOperation' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation' could be found (are you missing a using directive for 'System'?)
I am using the System reference though, so what am I doing wrong here? This is the code I'm using:
private static async void ConnectDevice(string deviceInfoID)
{
// Note: BluetoothLEDevice.FromIdAsync must be called from a UI thread because it may prompt for consent.
BluetoothLEDevice bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(deviceInfoID);
}

Related Links

Linq with Regex
Use of unassigned out parameter 'q' [duplicate]
Iterate ASP.NET MVC views to find all views supporting a specific model type
Eead text file with fixed columns in C#
How to zip a folders contents in C# even if a file is in use
null == null returning false?
(WPF) Rotate Grid with storyboard on MouseDown
DevExpress XtraReport Master-detail subreport exception when pass parameter from main report
Categorizing string based on input in C# [closed]
C# : Returning how many coins of what kind should be returned
Data Type Matching (Excel Column X Sql Server Column)
Execution stops in possible deadlock
Properties are listed twice in variable, but not in class
Task scheduler Issue
Cannot resolve TargetName… animation made via Blend doesnt actually work
RequestEntityTooLarge response from Web Api when trying to upload a file with HttpClient

Categories

HOME
asp.net
macros
salesforce
packet
snappy
opencv4android
itext7
salesforce-lightning
pandoc
coordinates
google-docs-api
checkpoint
docker-compose
minimax
google-my-business-api
apache-httpclient-4.x
select2
dynamics-crm-2011
tmux
fastreport
eclipse-orion
web-testing
conditional-formatting
hl7-fhir
tcpdf
rvm
quality-center
struts
aws-certificate-manager
boosting
csproj
concrete5
deferred
edsdk
exacttarget
log4net-configuration
wercker
storefront
unity3d-5
favorites
offset
android-geofence
abide
strategy-pattern
kepserverex
armadillo
mediastream
text-extraction
result
line-endings
hdpi
import.io
stanford-nlp-server
history
wink
openpgp.js
nservicebus6
glade
consolidation
deck.js
instaparse
csc
django-celery
boost-bind
sqlxml
skbio
markerspiderfier
computability
jts
hexagonal-tiles
p4python
mergecursor
nfa
strcpy
google-experiments
sync
yosemite
javacompiler
xts
episerver-7
xps
.net-reflector
ekevent
cab
violation
listpicker
symbian3
generator-expression
system.transactions
qt5.1
motordriver
big-endian
php-gettext
reflexil
optimistic-concurrency
mcpd
xpolog
gmagick
method-call
pkcs#7

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App