summaryrefslogtreecommitdiff
path: root/src/components/ble/NotificationManager.h
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-04-18 20:28:14 +0300
committerAvamander <avamander@gmail.com>2021-04-24 11:39:53 +0300
commit40d45d923b033363ff1304b47eac238dd4495a57 (patch)
tree9e7b668fdf23a7be892b8e2bf8b4d62b884cee06 /src/components/ble/NotificationManager.h
parente56ebb8bd621cc8838e86fa032d680a6e7a35ffc (diff)
Reformatted all the files according to clang-format style
Diffstat (limited to 'src/components/ble/NotificationManager.h')
-rw-r--r--src/components/ble/NotificationManager.h64
1 files changed, 39 insertions, 25 deletions
diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h
index 486bba15..8e8fb374 100644
--- a/src/components/ble/NotificationManager.h
+++ b/src/components/ble/NotificationManager.h
@@ -8,23 +8,35 @@
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{100};
+ public:
+ enum class Categories {
+ Unknown,
+ SimpleAlert,
+ Email,
+ News,
+ IncomingCall,
+ MissedCall,
+ Sms,
+ VoiceMail,
+ Schedule,
+ HighProriotyAlert,
+ InstantMessage
+ };
+ static constexpr uint8_t MessageSize {100};
- struct Notification {
- using Id = uint8_t;
- Id id;
- bool valid = false;
- uint8_t index;
- uint8_t size;
- std::array<char, MessageSize+1> message;
- Categories category = Categories::Unknown;
+ struct Notification {
+ using Id = uint8_t;
+ Id id;
+ bool valid = false;
+ uint8_t index;
+ uint8_t size;
+ std::array<char, MessageSize + 1> message;
+ Categories category = Categories::Unknown;
- const char* Message() const;
- const char* Title() const;
- };
- Notification::Id nextId {0};
+ const char* Message() const;
+ const char* Title() const;
+ };
+ Notification::Id nextId {0};
void Push(Notification&& notif);
Notification GetLastNotification();
@@ -35,18 +47,20 @@ namespace Pinetime {
bool IsVibrationEnabled();
void ToggleVibrations();
- static constexpr size_t MaximumMessageSize() { return MessageSize; };
+ static constexpr size_t MaximumMessageSize() {
+ return MessageSize;
+ };
size_t NbNotifications() const;
- private:
- Notification::Id GetNextId();
- static constexpr uint8_t TotalNbNotifications = 5;
- std::array<Notification, TotalNbNotifications> notifications;
- uint8_t readIndex = 0;
- uint8_t writeIndex = 0;
- bool empty = true;
- std::atomic<bool> newNotification{false};
- bool vibrationEnabled = true;
+ private:
+ Notification::Id GetNextId();
+ static constexpr uint8_t TotalNbNotifications = 5;
+ std::array<Notification, TotalNbNotifications> notifications;
+ uint8_t readIndex = 0;
+ uint8_t writeIndex = 0;
+ bool empty = true;
+ std::atomic<bool> newNotification {false};
+ bool vibrationEnabled = true;
};
}
} \ No newline at end of file