[SOLVED] ESP_GATTC_CONNECT_EVT fired for each gattc_if when multiple apps registered

filimonic
Posts: 2
Joined: Tue Jun 18, 2019 9:34 pm

[SOLVED] ESP_GATTC_CONNECT_EVT fired for each gattc_if when multiple apps registered

Postby filimonic » Tue Jun 18, 2019 9:48 pm

I see something strange in ESP32 BLE GATTC:
If I register multiple apps, the ESP_GATTC_CONNECT_EVT is fired on each app with different interfaces gattc_if and same bda
Am I doing something wrong?
I see in example gattc_multi_connect.c information about thin behaviour, but isn't it a bug ?

Code: Select all

I (1008) SRB_BLEC: GATT App registered # 0 : if 3 // ( save gattc_if for application as app[0].gattc_if=3)
I (1008) SRB_BLEC: GATT App registered # 1 : if 4 // ( save gattc_if for application as app[1].gattc_if=4)
I (1018) SRB_BLEC: GATT App registered # 2 : if 5 // ( save gattc_if for application as app[2].gattc_if=5)
I (1018) SRB_BLEC: GATT App registered # 3 : if 6 // ( save gattc_if for application as app[3].gattc_if=6)

I (2038) SRB_BLEC: FOUND DEVICE!
I (2038) SRB_BLEC: srb_ble_client_register (my function) : idx: 0 if: 3
// Here we make esp_ble_gattc_open(app[idx].gattc_if, bda, addr_type, true )

I (2358) SRB_BLEC: Connect if:3 connid:0
I (2368) SRB_BLEC: 72 55 53 07 46 74
// That is normal, Connect for the first device (app[0].gattc_if == 3) and print it's bda

I (2368) SRB_BLEC: Open if:3 status:0
// That is normal, Open for the first device (app[0].gattc_if == 3) and print it's bda

I (2368) SRB_BLEC: Connect if:4 connid:0
I (2368) SRB_BLEC: 72 55 53 07 46 74
// That is strange. ESP_GATTC_CONNECT_EVT is fired for second app's if (app[1].gattc_if == 4)

I (2378) SRB_BLEC: Connect if:5 connid:0
I (2378) SRB_BLEC: 72 55 53 07 46 74
// That is strange. ESP_GATTC_CONNECT_EVT is fired for third app's if (app[2].gattc_if == 5)

I (2388) SRB_BLEC: Connect if:6 connid:0
I (2388) SRB_BLEC: 72 55 53 07 46 74
// That is strange. ESP_GATTC_CONNECT_EVT is fired for fourth app's if (app[2].gattc_if == 5)
Last edited by filimonic on Wed Jun 19, 2019 7:14 pm, edited 1 time in total.

Weijian-Espressif
Posts: 29
Joined: Wed Aug 09, 2017 6:16 am

Re: ESP_GATTC_CONNECT_EVT fired for each gattc_if when multiple apps registered

Postby Weijian-Espressif » Wed Jun 19, 2019 2:34 am

This is normal behavior, and all apps will be notified when connected or disconnected.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 98 guests