diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-06-06 04:52:00 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2024-06-06 04:52:00 +0000 |
| commit | 8de07fe8fac23d508ae64dfd6ffb332f568f4e45 (patch) | |
| tree | 3e48ac0c3d9da1666f415040f378af2d42f62324 /src/drivers/include | |
| parent | 1242a199e3e28deab4720c33d988b371bd11ed25 (diff) | |
| download | tangara-fw-8de07fe8fac23d508ae64dfd6ffb332f568f4e45.tar.gz | |
daniel/bluetooth-avrc (#80)
Have a squizzy and lemme know if any issues @cooljqln 🐝
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/80
Co-authored-by: ailurux <ailuruxx@gmail.com>
Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/drivers/bluetooth.hpp | 6 | ||||
| -rw-r--r-- | src/drivers/include/drivers/bluetooth_types.hpp | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/drivers/include/drivers/bluetooth.hpp b/src/drivers/include/drivers/bluetooth.hpp index 6deeca05..94a85263 100644 --- a/src/drivers/include/drivers/bluetooth.hpp +++ b/src/drivers/include/drivers/bluetooth.hpp @@ -75,6 +75,10 @@ struct Avrc : public tinyfsm::Event { esp_avrc_ct_cb_event_t type; esp_avrc_ct_cb_param_t param; }; +struct Avrctg : public tinyfsm::Event { + esp_avrc_tg_cb_event_t type; + esp_avrc_tg_cb_param_t param; +}; } // namespace internal } // namespace events @@ -135,6 +139,7 @@ class BluetoothState : public tinyfsm::Fsm<BluetoothState> { virtual void react(events::internal::Gap ev) = 0; virtual void react(events::internal::A2dp ev){}; virtual void react(events::internal::Avrc ev){}; + virtual void react(events::internal::Avrctg ev){}; protected: static NvsStorage* sStorage_; @@ -206,6 +211,7 @@ class Connected : public BluetoothState { void react(events::internal::Gap ev) override; void react(events::internal::A2dp ev) override; void react(events::internal::Avrc ev) override; + void react(const events::internal::Avrctg ev) override; using BluetoothState::react; diff --git a/src/drivers/include/drivers/bluetooth_types.hpp b/src/drivers/include/drivers/bluetooth_types.hpp index 7cfb236f..d2e55ee5 100644 --- a/src/drivers/include/drivers/bluetooth_types.hpp +++ b/src/drivers/include/drivers/bluetooth_types.hpp @@ -5,6 +5,7 @@ #include <string> #include "memory_resource.hpp" +#include <variant> namespace drivers { namespace bluetooth { @@ -25,11 +26,27 @@ struct Device { int8_t signal_strength; }; -enum class Event { +enum class SimpleEvent { kKnownDevicesChanged, kConnectionStateChanged, kPreferredDeviceChanged, + // Passthrough events + kPlayPause, + kStop, + kMute, + kVolUp, + kVolDown, + kForward, + kBackward, + kRewind, + kFastForward, }; +struct RemoteVolumeChanged { + uint8_t new_vol; +}; + +using Event = std::variant<SimpleEvent, RemoteVolumeChanged>; + } // namespace bluetooth } // namespace drivers |
