Skip to content

Commit 39d5b5c

Browse files
minacodeminacode
and
minacode
authoredJul 9, 2023
NotificationManager.h: Reorder notification struct fields to allow easier creation. (InfiniTimeOrg#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]>
1 parent 5f3acfa commit 39d5b5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/components/ble/NotificationManager.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ namespace Pinetime {
2727
struct Notification {
2828
using Id = uint8_t;
2929
using Idx = uint8_t;
30-
Id id = 0;
31-
bool valid = false;
32-
uint8_t size;
30+
3331
std::array<char, MessageSize + 1> message;
32+
uint8_t size;
3433
Categories category = Categories::Unknown;
34+
Id id = 0;
35+
bool valid = false;
3536

3637
const char* Message() const;
3738
const char* Title() const;

0 commit comments

Comments
 (0)
Please sign in to comment.