diff options
| author | Max Friedrich <minacode@users.noreply.github.com> | 2023-07-09 14:39:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-09 14:39:38 +0200 |
| commit | 39d5b5c3a2e71696acb3cb639ee8de1b480eb5b8 (patch) | |
| tree | 3a60e35aea22c974bf365958c1b644a3ac17d64f /src/components/ble/NotificationManager.h | |
| parent | 5f3acfadd24fcf8f0ef31a75c36180585b1c88c4 (diff) | |
NotificationManager.h: Reorder notification struct fields to allow easier creation. (#1774)
This commit changes the order for the notification struct fields to allow the creation of notifications using a string literal.
```cpp
NotificationManager::Notifiation notification {
"String literal with notification text",
42,
NotificationManager::Categories::SimpleAlert
};
```
Co-authored-by: minacode <minamoto9@web.de>
Diffstat (limited to 'src/components/ble/NotificationManager.h')
| -rw-r--r-- | src/components/ble/NotificationManager.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h index 09b5a561..189a7e13 100644 --- a/src/components/ble/NotificationManager.h +++ b/src/components/ble/NotificationManager.h @@ -27,11 +27,12 @@ namespace Pinetime { struct Notification { using Id = uint8_t; using Idx = uint8_t; - Id id = 0; - bool valid = false; - uint8_t size; + std::array<char, MessageSize + 1> message; + uint8_t size; Categories category = Categories::Unknown; + Id id = 0; + bool valid = false; const char* Message() const; const char* Title() const; |
