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

C# visual control for editing statements / equations / conditions?
Generate new menus at timed intervals
Mongodb, linq driver. How to construct Contains with variable or statements
How do I retrieve a data type of tinyint from MySQL in C#?
DataTable Join using LINQ in C#
Second Unit Test Not Running
How do i use labels that are in Form1 dsigner at the new class?
LINQ to XML Not Working
c# Deserializing an element based on it's parent node's name
Using MemoryBarrier for Propagation of Changes in Dictionary<int, T> Multithreaded App
How do I know the server got closed with UDP using sockets
Extracting digits from a string five at a time in C#
Insert Error:Directory lookup for the file
C# UpdateResource function fails
6 bytes timestamp to DateTime
Collection item values missing in XML returned from WCF service

Categories

HOME
max
netty
alasql
cors
wifi
microcontroller
blob
ebay-api
hiveql
jshell
sahi
google-my-business-api
core-data
ndepend
facebook-sharer
fine-uploader
chef-recipe
hdf5
jinja2
lambda-calculus
hql
web-worker
multibinding
hl7-fhir
sonarlint
android-wifi
monad-transformers
cherrypy
rndis
matlab-gui
rvm
scrapy-spider
waterfall
smart-device
tftp
angular2-changedetection
jbossfuse
wordpress-rest-api
unity3d-5
circle
matlab-compiler
odp.net
kofax
scalamock
mybatis-generator
linkurious
ssdp
vertical-alignment
compiled-query
pexpect
bootstrap-carousel
pyopenssl
appcmd
sp
richtext
hellosign
node.js-client
timex
blitz3d
fileopendialog
cedar-bdd
android-tabs
symantec
dimensionality-reduction
settext
razorengine
pebble-js
bluetooth-lowenergy-4.2
nslocalizedstring
videoview
yfiles
ruby-1.8.7
mojolicious
transbase
edgar
jsoncpp
cloud-storage
openhab
syncano
winforms-interop
firewire
android-networking
transparentproxy
teamwork
system.diagnostics
radgrid
optimistic-locking
redmine-plugins
windows-search
pyalgotrade
fastcgi-mono-server
node-mongodb-native
mongoid4
nativequery
nomachine
svg-android
pechkin
leap-year
removeall
qmainwindow
pudb
feincms
jquery-1.8
win-prolog
advanceddatagrid
discussion-board
response-time
mass-emails
oaw
konsole
authkit
moores-law

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