diff options
| author | JF <jf@codingfield.com> | 2020-04-05 19:59:22 +0200 |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2020-04-05 19:59:22 +0200 |
| commit | 86d5732b960fbe7f81ed711b2de7e6b79293c96a (patch) | |
| tree | 8447f6b7bbff0f423e9cf5d15ed709c630bed25e /src/Components/Ble/NotificationManager.h | |
| parent | a91c68c931cc8308e87acd796afb46ba70ae3dc2 (diff) | |
| parent | 6e1bd118c5ecc53016548072501591b329500870 (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/Components/Ble/NotificationManager.h')
| -rw-r--r-- | src/Components/Ble/NotificationManager.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Components/Ble/NotificationManager.h b/src/Components/Ble/NotificationManager.h new file mode 100644 index 00000000..8edd6828 --- /dev/null +++ b/src/Components/Ble/NotificationManager.h @@ -0,0 +1,29 @@ +#pragma once + +#include <array> + +namespace Pinetime { + namespace Controllers { + class NotificationManager { + public: + enum class Categories {Unknown, SimpleAlert, Email, News, IncomingCall, MissedCall, Sms, VoiceMail, Schedule, HighProriotyAlert, InstantMessage }; + static constexpr uint8_t MessageSize = 18; + + struct Notification { + std::array<char, MessageSize> message; + Categories category = Categories::Unknown; + }; + + void Push(Categories category, const char* message, uint8_t messageSize); + Notification Pop(); + + + private: + static constexpr uint8_t TotalNbNotifications = 5; + std::array<Notification, TotalNbNotifications> notifications; + uint8_t readIndex = 0; + uint8_t writeIndex = 0; + bool empty = true; + }; + } +}
\ No newline at end of file |
