diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-02-12 17:07:39 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-02-12 17:07:39 +1100 |
| commit | 26df5c4a7f54d493a09724a5f4f8f4a3a5c90f31 (patch) | |
| tree | 168c313734ed388efa1847226d6cea61b8c0c7e0 /src/drivers/include | |
| parent | a7ac34eaa9b895e16aed816c504d167027898d7b (diff) | |
| download | tangara-fw-26df5c4a7f54d493a09724a5f4f8f4a3a5c90f31.tar.gz | |
Remember per-device bluetooth volume
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/bluetooth.hpp | 2 | ||||
| -rw-r--r-- | src/drivers/include/nvs.hpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/drivers/include/bluetooth.hpp b/src/drivers/include/bluetooth.hpp index 5fdd527c..988c7e93 100644 --- a/src/drivers/include/bluetooth.hpp +++ b/src/drivers/include/bluetooth.hpp @@ -35,7 +35,7 @@ class Bluetooth { auto IsEnabled() -> bool; auto IsConnected() -> bool; - auto ConnectedDevice() -> std::optional<bluetooth::Device>; + auto ConnectedDevice() -> std::optional<bluetooth::MacAndName>; auto KnownDevices() -> std::vector<bluetooth::Device>; diff --git a/src/drivers/include/nvs.hpp b/src/drivers/include/nvs.hpp index 1184b72c..264d9784 100644 --- a/src/drivers/include/nvs.hpp +++ b/src/drivers/include/nvs.hpp @@ -15,6 +15,7 @@ #include "bluetooth_types.hpp" #include "tasks.hpp" +#include "lru_cache.hpp" namespace drivers { @@ -28,6 +29,11 @@ class NvsStorage { auto PreferredBluetoothDevice() -> std::optional<bluetooth::MacAndName>; auto PreferredBluetoothDevice(std::optional<bluetooth::MacAndName>) -> bool; + using BtVolumes = util::LruCache<10, bluetooth::mac_addr_t, uint8_t> ; + + auto BluetoothVolumes() -> BtVolumes; + auto BluetoothVolumes(const BtVolumes&) -> bool; + enum class Output : uint8_t { kHeadphones = 0, kBluetooth = 1, |
