From 71b46730394979ea528d152dbe884cc35c368759 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 17 Jan 2024 11:48:40 +1100 Subject: all screens basically working, but bluetooth is rough --- src/drivers/include/bluetooth.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/drivers/include/bluetooth.hpp') diff --git a/src/drivers/include/bluetooth.hpp b/src/drivers/include/bluetooth.hpp index f3623fb8..4aefbc42 100644 --- a/src/drivers/include/bluetooth.hpp +++ b/src/drivers/include/bluetooth.hpp @@ -32,14 +32,20 @@ class Bluetooth { auto Disable() -> void; auto IsEnabled() -> bool; + auto IsConnected() -> bool; + auto ConnectedDevice() -> std::optional; + /* * Sets whether or not the bluetooth stack is allowed to actively scan for * new devices. */ auto SetDeviceDiscovery(bool) -> void; + auto IsDiscovering() -> bool; auto KnownDevices() -> std::vector; + auto SetPreferredDevice(const bluetooth::mac_addr_t& mac) -> void; + auto PreferredDevice() -> std::optional; auto SetSource(StreamBufferHandle_t) -> void; auto SetEventHandler(std::function cb) -> void; @@ -100,9 +106,11 @@ class BluetoothState : public tinyfsm::Fsm { static auto Init(NvsStorage& storage) -> void; static auto devices() -> std::vector; + static auto preferred_device() -> std::optional; static auto preferred_device(std::optional) -> void; + static auto scanning() -> bool; static auto discovery() -> bool; static auto discovery(bool) -> void; @@ -135,7 +143,7 @@ class BluetoothState : public tinyfsm::Fsm { static std::mutex sDevicesMutex_; static std::map sDevices_; static std::optional sPreferredDevice_; - static mac_addr_t sCurrentDevice_; + static std::optional sCurrentDevice_; static bool sIsDiscoveryAllowed_; static std::atomic sSource_; -- cgit v1.2.3