mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 08:38:39 +00:00
[bluetooth_proxy] Drop redundant remote_bda_ write in connect handler
get_connection_(msg.address, true) already populates remote_bda_ via set_address(): either the slot was found because get_address() == msg.address (so address_ and remote_bda_ already encode it), or a free slot was reserved and set_address(msg.address) was called, which writes remote_bda_[0..5] from the same bytes. The follow-up uint64_to_bd_addr(msg.address, connection->remote_bda_) just rewrites the identical bytes.
This commit is contained in:
@@ -201,7 +201,6 @@ void BluetoothProxy::bluetooth_device_request(const api::BluetoothDeviceRequest
|
||||
connection->set_connection_type(espbt::ConnectionType::V3_WITHOUT_CACHE);
|
||||
this->log_connection_info_(connection, "v3 without cache");
|
||||
}
|
||||
uint64_to_bd_addr(msg.address, connection->remote_bda_);
|
||||
connection->set_remote_addr_type(static_cast<esp_ble_addr_type_t>(msg.address_type));
|
||||
connection->set_state(espbt::ClientState::DISCOVERED);
|
||||
this->send_connections_free();
|
||||
|
||||
Reference in New Issue
Block a user