BLE or BR/EDR by conn_id?

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

cross mob
StN__1917156
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

Is there function or other mean after have conn_id to get from conn_id if this connection is BLE or classic?

Let say the example given in 002-23400_AN223400_Getting_Started_with_EZ-BT_WICED_Modules.pdf

where SPP and Hello_sensor are merged - how in the code can distinguish the type of bluetooth connection and at what stage, because at the beginning both processes are same?

Thanks

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

Depending up on the connection call backs , you can distinguish the type of Bluetooth connection.

For example , in the project which you are referring , call back function registered for GATT connection (wiced_bt_gatt_connection_status_t) will tell its a BLE connection  and for Classic it will be spp_connection_up_callback in wiced_bt_spp_reg_t .

Thanks,

Anjana

View solution in original post

0 Likes
3 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

Depending up on the connection call backs , you can distinguish the type of Bluetooth connection.

For example , in the project which you are referring , call back function registered for GATT connection (wiced_bt_gatt_connection_status_t) will tell its a BLE connection  and for Classic it will be spp_connection_up_callback in wiced_bt_spp_reg_t .

Thanks,

Anjana

0 Likes

That is how I'm doing it right now, but was interested if there is some ready function from the stack that could give the connection type by providing connectionId as parameter, because BR/EDR is not only the SPP. For the BLE part is quite easy as have to "hook" only in one place*_gatts_conn_status_cb

BTW: wiced_bt_gatt_connection_status_t has a field wiced_bt_transport_t    transport;   which could be: BT_TRANSPORT_BR_EDR  1 or  BT_TRANSPORT_LE   2,  so I'm curious how this field could become ever 1 (BT_TRANSPORT_BR_EDR) when BR/EDR doesnt have GATT?

Thanks

0 Likes

Hi ,

As per BT spec, there is an option for opening GATT over BR/EDR connection. In WICED , we have the API wiced_bt_gatt_bredr_connect .

In that case, wiced_bt_transport_t  of wiced_bt_gatt_connection_status_t  should result in BT_TRANSPORT_BR_EDR

As per my knowledge this is not used in any profiles currently. So this case will not occur in any applications.

Reference: https://epxx.co/artigos/bluetooth_gatt.html

Thanks,

Anjana

0 Likes