Skip to content

Commit f275b82

Browse files
committed
call init_nvs() in all cases
1 parent b6a20dd commit f275b82

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/BluetoothA2DPSink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ void BluetoothA2DPSink::start(const char *name) {
129129
}
130130
ESP_LOGI(BT_AV_TAG, "Device name will be set to '%s'", this->bt_name);
131131

132+
// Initialize NVS
133+
init_nvs();
132134
if (is_autoreconnect_allowed) {
133-
// Initialize NVS
134-
init_nvs();
135135

136136
// reconnect management
137137
// grab last connnectiom, even if we dont use it now for auto reconnect

src/BluetoothA2DPSource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ void BluetoothA2DPSource::start(std::vector<const char *> names) {
9191
is_end = false;
9292
is_autoreconnect_allowed = (reconnect_status == AutoReconnect);
9393

94+
init_nvs();
9495
if (is_autoreconnect_allowed) {
95-
init_nvs();
9696
// get last connection if not available
9797
if (!has_last_connection()) {
9898
get_last_connection();
@@ -511,6 +511,7 @@ void BluetoothA2DPSource::av_hdl_stack_evt(uint16_t event, void *p_param) {
511511
* by the peer device. */
512512
// esp_bt_gap_set_scan_mode(ESP_BT_NON_CONNECTABLE,
513513
// ESP_BT_NON_DISCOVERABLE);
514+
delay_ms(10000);
514515
set_scan_mode_connectable(false);
515516

516517
if (reconnect_status == AutoReconnect && has_last_connection()) {

0 commit comments

Comments
 (0)