echo_salik echo_salik - 1 month ago 6
Javascript Question

UWP BTLE Application

I am trying to make a BTLE App using UWP in JS. I cannot find any examples and I cannot understand the documentations. Can anyone help me out and point me in the right direction as to from where should I begin?

In using VS2015 Community Edition w/ Windows 10 SDK Build 14393. My phone is also 14393 so is my PC. I can compile the app but I don't know from where to begin.

EDIT:

The way the docs are, is quiet confusing. Like in this page this is an example.

var bluetoothLEDevice = device;


This does not state where this this
device
variable came from, it took me a while to file the link between this and the
BluetoothDevice
Class but still it was unclear on how I am supposed to use it. There are no code blocks to liked in the page. Microsoft maintains a GitHut hub account so it will be great for NEWBs like me to see a working example or related example for all the supported languages on GitHub (I know it's a lot, but Microsoft is a big cooperation so it is possible).

Thank you for understanding what was I trying to say @Grace Feng - MSFT.

Answer

I cannot find any examples and I cannot understand the documentations.

If you're asking for one official UWP BLE sample which is wrote in JS, I'm afraid to tell you that there is no such one.

By not understanding the documentations, you mean you don't understand the code sample in those documents? We don't know that blocks you, next time when you ask a question, you'd better share us your code the point what exactly the problem is.

I can compile the app but I don't know from where to begin.

To get started, I think it's better to stick to the official document Bluetooth GATT and the official Bluetooth Low Energy client sample, you can try to adapter it to JS code, what you need is checking the js Apis which are used in those samples, for example GattCharacteristic class.

The official Bluetooth advertisement sample has a code sample in js version, it demonstrates use of the Bluetooth Advertisement Runtime API to send and receive Bluetooth Low Energy advertisements. Maybe you can also take a look to get started.

Comments