BLE Example
12/5/17 7:07 PM

Hi All,

I am playing with the SendAccelDataOverBle example in the Workbench.

After building the project and flashing it to the XDK, I connected the device to my phone using the APP "LightBlue".

But nothing happened when the connection was built.

Please help me!



0 (0 Votes)
RE: BLE Example
12/6/17 11:30 AM as a reply to Zhefei Xiao.
Hi Zhefei!

How are you?

Just a hint, since the BidirectionalService of the XDK BLE only perform notification, the problem you are facing could be to enable notifications on Central device, check on your BLE app to enable Notifications listening on the characteristic which has the Notify property, in your case on the second characteristic discovered.

This could work to you.

Let me know if this hint was useful.


0 (0 Votes)
RE: BLE Example
12/6/17 4:39 PM as a reply to Felipe Neves.

Hello Zhefei,

first of all, could you elaborate what you mean by But nothing happened when the connection was built.?

Obviously, your Smartphone connected to the XDK, if the log and the screen may be believed. Additionally, if the XDK has built a connection, the message Device connected : should appear in the console of your XDK-Workbench.

Finally, to start the transfer of Accelerometer data, the message start has to be sent to the XDK via Bluetooth via the Write-Characteristic (the UUID starts with 0x0C68D100). I have tried out the Lightblue App, and found that the message must actually be sent as hexadecimal values, so you probably have to send the message 7374617274, which is start with the letters converted to hex values. If you want the transfer to end, you have to send end, which is 656e64 as hex values.

Then, as Felipe mentioned, you have to select the other characteristic and subscribe to notifications. The XDK will then send accelerometer values, which are represented as hex values as well.

In fact, if it is only for the sake of testing / trying out, I would recommend to use the app BLE Scanner, because that App actually presents the data as human-readable string.

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,

0 (0 Votes)