diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-09-22 15:48:41 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-09-22 21:19:19 +1000 |
| commit | b192975cb1eeb4e6b7c7bf53cdf42701c55f034a (patch) | |
| tree | 39755851543d596f2630704be9efb56be1f39bfc /src/ui/include/screen_settings.hpp | |
| parent | cbd99b2134c6c471708deb409a4b0fcc4c31516d (diff) | |
| download | tangara-fw-b192975cb1eeb4e6b7c7bf53cdf42701c55f034a.tar.gz | |
make bluetooth pairing ui functional
Diffstat (limited to 'src/ui/include/screen_settings.hpp')
| -rw-r--r-- | src/ui/include/screen_settings.hpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ui/include/screen_settings.hpp b/src/ui/include/screen_settings.hpp index caa23fd4..4e1936a2 100644 --- a/src/ui/include/screen_settings.hpp +++ b/src/ui/include/screen_settings.hpp @@ -8,9 +8,12 @@ #include <stdint.h> #include <cstdint> +#include <list> #include <memory> #include <vector> +#include "bluetooth.hpp" +#include "bluetooth_types.hpp" #include "display.hpp" #include "index.hpp" #include "lvgl.h" @@ -28,7 +31,24 @@ class Settings : public MenuScreen { class Bluetooth : public MenuScreen { public: - Bluetooth(); + Bluetooth(drivers::Bluetooth& bt, drivers::NvsStorage& nvs); + + auto ChangeEnabledState(bool enabled) -> void; + auto RefreshDevicesList() -> void; + auto OnDeviceSelected(size_t index) -> void; + + private: + auto RemoveAllDevices() -> void; + auto AddPreferredDevice(const drivers::bluetooth::Device&) -> void; + auto AddDevice(const drivers::bluetooth::Device&) -> void; + + drivers::Bluetooth& bt_; + drivers::NvsStorage& nvs_; + + lv_obj_t* devices_list_; + lv_obj_t* preferred_device_; + + std::list<drivers::bluetooth::mac_addr_t> macs_in_list_; }; class Headphones : public MenuScreen { |
