From b192975cb1eeb4e6b7c7bf53cdf42701c55f034a Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 22 Sep 2023 15:48:41 +1000 Subject: make bluetooth pairing ui functional --- src/ui/include/screen_settings.hpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/ui/include/screen_settings.hpp') 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 #include +#include #include #include +#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 macs_in_list_; }; class Headphones : public MenuScreen { -- cgit v1.2.3