summaryrefslogtreecommitdiff
path: root/src/Components/Ble/NotificationManager.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-04-05 17:59:22 (GMT)
committerGitea <gitea@fake.local>2020-04-05 17:59:22 (GMT)
commit86d5732b960fbe7f81ed711b2de7e6b79293c96a (patch)
tree8447f6b7bbff0f423e9cf5d15ed709c630bed25e /src/Components/Ble/NotificationManager.h
parenta91c68c931cc8308e87acd796afb46ba70ae3dc2 (diff)
parent6e1bd118c5ecc53016548072501591b329500870 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/Components/Ble/NotificationManager.h')
-rw-r--r--src/Components/Ble/NotificationManager.h29
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 0000000..8edd682
--- /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