You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this sample, I try to set the bluetooth tx power lowest after phone has connected, so that I can disconnect quickly when get away from esp32.
I use esp_bt_controller_disable() and esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT) after esp_bredr_tx_power_set(), it looks like that another phone can't discover the esp32 in 3 meters away, but in the same distance, the phone that has connected would not disconnect, the power is still strong.
Could Someone take a try? I dont know if there any wrong with me or bug?
THX!
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
esp_bredr_tx_power_set() doesnt change all tx power when phone connecter esp32 with classic bluetooth???
esp_bredr_tx_power_set() doesnt change all tx power when phone connecter esp32 with classic bluetooth??? (IDFGH-14725)
Feb 25, 2025
Whrn the example conneted to any device, it will be set to non-discoverable. So it will not be discovered by any other devices.
case ESP_HIDD_OPEN_EVT:
if (param->open.status == ESP_HIDD_SUCCESS) {
if (param->open.conn_status == ESP_HIDD_CONN_STATE_CONNECTING) {
ESP_LOGI(TAG, "connecting...");
} else if (param->open.conn_status == ESP_HIDD_CONN_STATE_CONNECTED) {
ESP_LOGI(TAG, "connected to %02x:%02x:%02x:%02x:%02x:%02x", param->open.bd_addr[0],
param->open.bd_addr[1], param->open.bd_addr[2], param->open.bd_addr[3], param->open.bd_addr[4],
param->open.bd_addr[5]);
bt_app_task_start_up();
ESP_LOGI(TAG, "making self non-discoverable and non-connectable.");
esp_bt_gap_set_scan_mode(ESP_BT_NON_CONNECTABLE, ESP_BT_NON_DISCOVERABLE); // <=============
} else {
ESP_LOGE(TAG, "unknown connection status");
}
} else {
ESP_LOGE(TAG, "open failed!");
}
break;
If you disable and re-enable the controller, it does not make sense if the connection doesn't disconnect. I just tested it. When I call disable&enable after the device is connected, the connection between esp32 and the mobile phone will be disconnected.
https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/classic_bt/bt_hid_mouse_device
In this sample, I try to set the bluetooth tx power lowest after phone has connected, so that I can disconnect quickly when get away from esp32.
I use esp_bt_controller_disable() and esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT) after esp_bredr_tx_power_set(), it looks like that another phone can't discover the esp32 in 3 meters away, but in the same distance, the phone that has connected would not disconnect, the power is still strong.
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32/api-reference/bluetooth/controller_vhci.html notes that "The power level will affect the global BR/EDR TX power for operations such as inquiry, page, and connection."
Could Someone take a try? I dont know if there any wrong with me or bug?
THX!
The text was updated successfully, but these errors were encountered: