Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Wi-Fi Combo Forum Discussions

Anonymous
Not applicable

jaeyoungmwf_mmfae

Hi,

I wanted to disconnect my WICED device(BLE peripheral) from Smartphone(BLE central) after all operations are completed.

To do this, I was looking for an API to disconnect, but can't find the same.

Is there any API available or any other alternative way to disconnect from central device ?

0 Likes
1 Solution
JaeyoungY_71
Employee
100 likes received 50 likes received 25 likes received
Employee

Hi Rajvirsinh,

So sorry for my mistake! WICED indeed supports this feature and can be used with following function

tGATT_STATUS wiced_bt_gatt_disconnect (UINT16 conn_id)

The conn_id is the wiced_bt_gatt_connection_status_t.conn_id reported in GATT_CONNECTION_STATUS_EVT. For every device you will have to keep track of the conn_id that it wants to disconnect from.

Hope this helped.

Thanks,

Jaeyoung

View solution in original post

4 Replies
JaeyoungY_71
Employee
100 likes received 50 likes received 25 likes received
Employee

Hi Rajvirsinh,

In BLE the peripheral device is the slave and the central device the master, thus it has to be the central device initiating the disconnection. You would have to detect when all operations are completed on your Smartphone and initiate the disconnection from there.

Thanks,

Jaeyoung

0 Likes
Anonymous
Not applicable

Hi jaeyoung

Acc to BLE specs it is possible to disconn BLE link from peripheral device. I personally have tried on TI & Nordic stack.

So my question is, @does wiced wifi supports this feature or not?

0 Likes
JaeyoungY_71
Employee
100 likes received 50 likes received 25 likes received
Employee

Hi Rajvirsinh,

So sorry for my mistake! WICED indeed supports this feature and can be used with following function

tGATT_STATUS wiced_bt_gatt_disconnect (UINT16 conn_id)

The conn_id is the wiced_bt_gatt_connection_status_t.conn_id reported in GATT_CONNECTION_STATUS_EVT. For every device you will have to keep track of the conn_id that it wants to disconnect from.

Hope this helped.

Thanks,

Jaeyoung

Anonymous
Not applicable

Hi jaeyoung,

This API is working fine.

Thanks for the help.

0 Likes