Skip to content

Commit

Permalink
NotificationManager.h: Reorder notification struct fields to allow ea…
Browse files Browse the repository at this point in the history
…sier 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 <[email protected]>
  • Loading branch information
minacode and minacode authored Jul 9, 2023
1 parent 5f3acfa commit 39d5b5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/ble/NotificationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39d5b5c

Please sign in to comment.