Auto-confirmation of BLE indications while disconnected from central while sending indications at a relatively high frequency

Hello,

Context : I use the nrf52dk with nrf connect for vscode and nrf connect for smartphone (android last version). I use the last version of everything.

My code to send indications is the same as the one from the Nordic dev Academy.

I spent three days of my internship around this error.

Description of the problem : If I disconnect my smartphone (totally deactivating Bluetooth or just clicking on disconnect in nrf connnect app) while sending indications every 0.5s from my peripheral, the stack will not trigger any disconnected or recycled event and my indication callback function will still be called with err =0, which means that my indications were somehow confirmed, this will keep going for ever. But this should be impossible, or maybe the BLE stack from zephyr is autoconfirming its own indications. This is a big security flaw as I use indications to ensure that my central correctly received the peripheral's informations...

static void indicate_cb(struct bt_conn *conn,
                        struct bt_gatt_indicate_params *params,
                        uint8_t err)
But here is where it gets interesting : If I send indications with a lower frequency (1 s period) it will eventually detect that the indication confirmation failed, then a disconnected and recycled event will be triggered. Still, it takes two or three auto-confirmed indications before the stack detects that there are no response from the central.
WIth an even larger period (5 s) the disconnection is directly detected.
I would appreciate some expert help for this one, particulary in the zephyr's bluetooth LE stack. I couldn't find any auto-confirmation code in the stack... so this problem remains very mysterious to me.

Thanks in advance
Best regards,
Cjeodv
Related