Hi, I'm using esp-idf and bluedroid.
I would like to implement a feature that allows the user to press and hold a button, which triggers the following sequence
- Disconnect device from host
- Clear all bonding information
- Start advertising
The purpose of this is ease of portability between host machines, as it will be used on multiple devices frequently, rather than tracking credentials, a clean slate would be better.
The issue I'm having is that
- the host (macbook in this case) tries to reconnect automatically
- then the device is missing the key
- the connection attempt fails
- the device stops advertising until I manually start via button press.
When I increased the advertisement interval, the host connection attempt times out, and I see the advertisement, but then the problem becomes latency.
Is there a better workflow to accomplish this?
do I need to add another SW timer to kick off the start of advertising?
Any advice is welcome, thank you.
Workflow suggestions for clearing bonded devices and advertising
-
- Posts: 1731
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Workflow suggestions for clearing bonded devices and advertising
Do you have code in place to restart advertising like https://github.com/espressif/esp-idf/bl ... C1-L489C15
?
Code: Select all
case ESP_GATTS_DISCONNECT_EVT:
ESP_LOGI(GATTS_TAG, "ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x%x", param->disconnect.reason);
esp_ble_gap_start_advertising(&adv_params);
break;
Re: Workflow suggestions for clearing bonded devices and advertising
I did, but I took it out when I wanted the button to trigger advertising.
That sounds like it'll sort me out. Thank you.
That sounds like it'll sort me out. Thank you.
Who is online
Users browsing this forum: Google [Bot], mikl604 and 127 guests