summaryrefslogtreecommitdiff
path: root/src/components/ble/NotificationManager.h
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2020-10-04 10:21:22 (GMT)
committerGitHub <noreply@github.com>2020-10-04 10:21:22 (GMT)
commit39954bbd3afb592a0c3109e3479594183e8d0778 (patch)
tree58efd04aa38b8dc7989c51fe3c9cdb9a3fb46a54 /src/components/ble/NotificationManager.h
parent5adc97702c326d0252df6da75ce4ac244a4b3553 (diff)
parent6c86d1d9d706706fcb6f214aba8259e61ed68755 (diff)
Merge pull request #68 from Avamander/patch-1
Rename folders to follow a consistent style
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..daa1571
--- /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+1> 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