diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-02-13 10:32:59 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-02-13 10:32:59 +1100 |
| commit | 15f3da0f8ca9b85125ac557aa15c222e50fc8c8a (patch) | |
| tree | 3f24a7429ed922781c22084c1dc0aeb319d96675 /src/drivers/bluetooth.cpp | |
| parent | 26ae027d6721510e4b4a8107e95acc57efaaf2c6 (diff) | |
| parent | cb379f4bc3c51eacf80b786566ab3c2675191164 (diff) | |
| download | tangara-fw-15f3da0f8ca9b85125ac557aa15c222e50fc8c8a.tar.gz | |
Merge branch 'main' into scroll-sensitivity
Diffstat (limited to 'src/drivers/bluetooth.cpp')
| -rw-r--r-- | src/drivers/bluetooth.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/drivers/bluetooth.cpp b/src/drivers/bluetooth.cpp index 1a303748..84c81de0 100644 --- a/src/drivers/bluetooth.cpp +++ b/src/drivers/bluetooth.cpp @@ -103,21 +103,12 @@ auto Bluetooth::IsConnected() -> bool { return bluetooth::BluetoothState::is_in_state<bluetooth::Connected>(); } -auto Bluetooth::ConnectedDevice() -> std::optional<bluetooth::Device> { +auto Bluetooth::ConnectedDevice() -> std::optional<bluetooth::MacAndName> { auto lock = bluetooth::BluetoothState::lock(); if (!bluetooth::BluetoothState::is_in_state<bluetooth::Connected>()) { return {}; } - auto looking_for = bluetooth::BluetoothState::preferred_device(); - if (!looking_for) { - return {}; - } - for (const auto& dev : bluetooth::BluetoothState::devices()) { - if (dev.address == looking_for->mac) { - return dev; - } - } - return {}; + return bluetooth::BluetoothState::preferred_device(); } auto Bluetooth::KnownDevices() -> std::vector<bluetooth::Device> { |
