ESP-IDF BLE unauthenticated device sends data within 30s

kurtisblow
Posts: 8
Joined: Fri Oct 23, 2020 6:41 am

ESP-IDF BLE unauthenticated device sends data within 30s

Postby kurtisblow » Tue May 11, 2021 9:28 am

Hi,

I try to use the gatt_security_server example in my project to achieve bonding and it works fine so far. When I connect
over the nRF Connect App from Nordic, a secure connection is etablished and the device is bonded.

But when now third party device connects, which does not support bonding, it still can send write events within 30s,
before it is disconnected.

To prevent this, I want to set a flag for each connection_id, such that I only allow a write event, when the device is authenticated.
In the gap_event_handler(), I receive a successful authentication, but I cannot read the according connection_id, so I don't know which device I need to disconnect. So is there a way, to receive the connection_id in the gap_event_handler()? Or is there another way to prevent an unauthenticated device from sending data?


Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 232 guests