Page 1 of 1

Complete Beginner Help with BLE Connection

Posted: 23:06, 11 Sep 2015
by biczak
I am an absolute beginner when it comes to using Javascript to connect to a BLE device. I am trying to make an Android app with Cordova, written in HTML and Javascript, that will automatically search for a specific BLE device, connect to it, and display a specific characteristic. I have played around with the "BLE Discovery" example from the EvoThings Workbench and can see my BLE Device in my app, but can not connect to it. The name of the device is "Emulator" and the specific characteristic UUID is 10AA2957-3515-11E4-8C21-0800200C9A66 which has a Hex value that I'd like to convert to a decimal.

Unfortunately, I am totally lost and have no idea where to begin. Any help would be greatly appreciated!

Re: Complete Beginner Help with BLE Connection

Posted: 11:42, 12 Sep 2015
by Fredrik
A characteristic value is delivered as an ArrayBuffer. To convert that to a String, you may use the function evothings.ble.fromUtf8(). Note that this function will throw an exception if the data is not valid UTF-8.