From 39d5b5c3a2e71696acb3cb639ee8de1b480eb5b8 Mon Sep 17 00:00:00 2001 From: Max Friedrich Date: Sun, 9 Jul 2023 14:39:38 +0200 Subject: 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 --- src/components/ble/NotificationManager.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/components') 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 message; + uint8_t size; Categories category = Categories::Unknown; + Id id = 0; + bool valid = false; const char* Message() const; const char* Title() const; -- cgit v1.2.3-70-g09d2