Author: Max Friedrich <minacode@users.noreply.github.com>
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>
src/components/ble/NotificationManager.h | 7 ++++---
diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h index 09b5a5610edc67ad9bbf67f00a8e51884c4375d1..189a7e13555340325c6ac425485701be9fbfe2c0 100644 --- a/src/components/ble/NotificationManager.h +++ b/src/components/ble/NotificationManager.h @@ -27,11 +27,12 @@ struct Notification { using Id = uint8_t; using Idx = uint8_t; + + std::array<char, MessageSize + 1> message; + uint8_t size; + Categories category = Categories::Unknown; Id id = 0; bool valid = false; - uint8_t size; - std::array<char, MessageSize + 1> message; - Categories category = Categories::Unknown; const char* Message() const; const char* Title() const;