diff options
Diffstat (limited to 'src/Components/Ble/MusicService.h')
-rw-r--r-- | src/Components/Ble/MusicService.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Components/Ble/MusicService.h b/src/Components/Ble/MusicService.h index ba872358..ab6db572 100644 --- a/src/Components/Ble/MusicService.h +++ b/src/Components/Ble/MusicService.h @@ -1,4 +1,5 @@ #pragma once + #include <cstdint> #include <array> #include <host/ble_gap.h> @@ -9,10 +10,14 @@ #define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7} namespace Pinetime { + namespace System { + class SystemTask; + } namespace Controllers { + class MusicService { public: - MusicService(); + MusicService(Pinetime::System::SystemTask &system); void Init(); int OnCommand(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt); @@ -20,6 +25,8 @@ namespace Pinetime { std::string artist(); std::string track(); std::string album(); + unsigned char status(); + void event(char event); static const char EVENT_MUSIC_OPEN = 0xe0; @@ -29,7 +36,8 @@ namespace Pinetime { static const char EVENT_MUSIC_PREV = 0x04; static const char EVENT_MUSIC_VOLUP = 0x05; static const char EVENT_MUSIC_VOLDOWN = 0x06; - + static const char STATUS_MUSIC_PAUSED = 0x00; + static const char STATUS_MUSIC_PLAYING = 0x01; private: static constexpr uint8_t msId[2] = {0x00, 0x01}; @@ -67,13 +75,17 @@ namespace Pinetime { struct ble_gatt_chr_def characteristicDefinition[6]; struct ble_gatt_svc_def serviceDefinition[2]; - + uint16_t m_eventHandle; std::string m_artist; std::string m_album; std::string m_track; + unsigned char m_status; + + Pinetime::System::SystemTask& m_system; + }; } } |