BLE client for XDK in android
응답
16. 7. 11 오전 11:27

Hello,

I am looking to crete an application to read XDK data over BLE in android application. I browsed through Internet but did not find anything helpful. If someone can point where to start with then it will be helpful.

Thanks

+2 (2 투표)
RE: BLE client for XDK in android
응답
16. 7. 11 오전 11:48 as a reply to Kayne Tan.

Hello Kayne,

would you be so kind, and tell me if you need support about the XDK, Android or both applications.
Did you check our basic XDK BLE guide that you can find here?

Kind regards,
Manuel

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 12 오전 3:59 as a reply to Manuel Cerny.

Hello Manuel,

Thanks for replying.

I have flashed firmware present in: "samples\XDKSensorMonitor_v4\XDK\src\DSM_demoSensorMonitor" folder and i could see data over WiFi in given sample android app.

What i am looking now is to use BLE to receive same data in android application. I am not looking to program anything in XDK presently. Just need a pointer to start developing Android application that receives XDK (having above mentioned firmware) data over BLE.

The link you mentioned, seems to me as it is related to program firmware. Correct me if I am wrong. And i assume i need to understand ALPWise BLE stack to create android client listening to XDK data over BLE.

Thanks

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 12 오전 9:25 as a reply to Kayne Tan.

Hello Kayne,

You are right, the link above is to implement the BLE server/peripheral on the XDK.
Nevertheless I would recommend to go through it, to get a better understanding about how the Alpwise BLE stack is working. As you have mentioned, it is essentially to know when implementing the Android client.

If you want to build your application based on the existing Demo SensorMonitor and make use of the data, you need to know how the data is sended.
The BLE guide is based on the proprietary Alpwise Data Exchange Service just as the SensorMonitor. If you understand the guide, you will be able to analyse the related parts of the demo.

In BLE_com_cc.c you find the implementation of the BLE service.
And what is more important you can find the structure of the sended data sensorDataSendIntStruct_t in DTA_send_cc.c.

A good starting point for the android application is the bluetooth section on the android developer side that you can find here.

I hope this help you to get started.
Please don’t hesitate to ask if you have further questions.

Kind regards,
Manuel

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 12 오전 10:57 as a reply to Manuel Cerny.

Thanks Manuel for reply

I have implemented as per standerd ble stack, now I found custom services and characteristics(see list below ) in my android application, now i have a question, like which characteristics is for which value, can you suggest any documnet regarding this. for example how can i retrive temperature value in my android application.

*Characteristics List

Service Changed, UUID=00002a05-0000-1000-8000-00805f9b34fb
Device Name, UUID=00002a00-0000-1000-8000-00805f9b34fb
Appearance, UUID=00002a01-0000-1000-8000-00805f9b34fb
Peripheral Privacy Flag, UUID=00002a28-0000-1000-8000-00805f9b34fb
Manufacturer Name String, UUID=00002a29-0000-1000-8000-00805f9b34fb
Unknown characteristic, UUID=00005302-0000-0041-4c50-574953450000
Unknown characteristic, UUID=00005303-0000-0041-4c50-574953450000

Thanks!

 

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 13 오전 6:00 as a reply to Kayne Tan.

Hi Kayne,

as you already printed out, the last two characteristics in your list are the ones from the ALPWISE Data Exchange Service, as you can already read in the BLE XDK tutorial at the bottom of page 4:
"In this ALPWISE Data Exchange Service there are two characteristics:

- „RX Data“ with write methods and no security requirements
(0x00005302-0000-0041-4C50-574953450000)

- „TX Data“ with notify and indicate methods and no security requirements
(0x00005303-0000-0041-4C50-574953450000)"

So if you want to receive data from the XDK you should enable notifications  on the TX Data characteristics (TX from the perspective of the XDK)  from your Android app (see here and especially the chapter "Receiving Gatt Notifications").

- Manuel

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 14 오후 12:36 as a reply to Manuel Cerny.

Hello Manuel,

I tried it in the way as it is described in link you provided. I could not receive data from XDK.

I installed an app from: https://play.google.com/store/apps/details?id=io.github.webbluetoothcg.bletestperipheral&hl=en and i can receive notifications from that app using the same code.

Do you think of any possibility of my missing any point?

We have 2 services one to read and other to write. So do you think i need to write anything to XDK before trying to read or get notified from it?

I also assume that there would not be multiple services for multiple sensors present in kit. It would be this same service having bit-format differentiating data from different sensor.

Thanks

0 (0 투표)
RE: BLE client for XDK in android
응답
16. 7. 17 오후 7:22 as a reply to Kayne Tan.

Hi Kayne,

I think you're almost there! Since you're using the demo application on the XDK you just need to send 'start' to the XDK now, to enable the sending of the accelerometer data. Please note that this is not mandatory for the Alpwise Data Exchange Service but it is, for this special xdk demo applcation. 

For the other topic: yes you can use this way of communication to send any data you would like to publish from your XDK. If you want get deeper into special BLE profiles the XDK is supporting, you can check out the demo application VirtualXDK.

- Manuel

0 (0 투표)