6 posts / 0 new
Last post
Bharath
Offline
Last seen:1 year 3 months ago
加入:2016-04-14 07:03
BLE Connection state

I am using throughput_eval app for my application. Instead of start command from smart snippets I want to enable transmission if the BLE is connected.
How to check if the BLE is in connected state? Please help me.

Thank you
Bharath

Device:
MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 34
Hi Bharath,

Hi Bharath,

You can check if your device is connected by checking the state of the TASK_APP task in your application. You can check if the TASK_APP is in the APP_CONNECTED state.

Thanks MT_dialog

Bharath
Offline
Last seen:1 year 3 months ago
加入:2016-04-14 07:03
It did not work for me.

It did not work for me.
任何不her ways to do this?

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 34
Hi Bharath,

Hi Bharath,

I cant see any reason for this not to work, when you are connected, in the app_connection_func() the code changes the state of your application, so if you stay connected, the ke_state_get(TASK_APP) should return the state of your application. Other than that you can set your own variable upon connection and check that.

Thanks MT_dialog

Bharath
Offline
Last seen:1 year 3 months ago
加入:2016-04-14 07:03
Thank you MT_dialog,

Thank you MT_dialog,

I am successful in finding the connection state.
Now I want to enable notifying data only when a request is made by the central( In our case it is android). How to do this?
Or in more clear words, how to receive the data sent from the android?

Thank you
Bharath

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 34
Hi Bharath,

Hi Bharath,

You can have a characteritic that will be writable and an other that will be notifiable, and as soon as this write characteristic gets written from the central you start a timer that will send a notification to your central (you also have to enable the notifications from the central for the notifiable characteristic). This demonstration is implemented at the ble_app_peripheral example in the SDK.

Thanks MT_dialog