summaryrefslogtreecommitdiff
path: root/src/components/ble/NotificationManager.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-10-21 15:31:56 (GMT)
committerJF <jf@codingfield.com>2020-10-21 15:31:56 (GMT)
commit440ae412b9ce9c868aa8b98e6da537bd0ec62de7 (patch)
treea4800f9992e35fe22d0acb1e0136c35133abbad4 /src/components/ble/NotificationManager.cpp
parentef5670c7e09a1a63fc5df4a066472ed7fe7550ff (diff)
Increase max size of notification message to 100 char.
Fix bug in message handling that would ignore the last character of the notification.
Diffstat (limited to 'src/components/ble/NotificationManager.cpp')
-rw-r--r--src/components/ble/NotificationManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/ble/NotificationManager.cpp b/src/components/ble/NotificationManager.cpp
index 4297cde..6ed3f83 100644
--- a/src/components/ble/NotificationManager.cpp
+++ b/src/components/ble/NotificationManager.cpp
@@ -4,10 +4,13 @@
using namespace Pinetime::Controllers;
+constexpr uint8_t NotificationManager::MessageSize;
+
+
void NotificationManager::Push(Pinetime::Controllers::NotificationManager::Categories category,
const char *message, uint8_t currentMessageSize) {
// TODO handle edge cases on read/write index
- auto checkedSize = std::min(currentMessageSize, uint8_t{18});
+ auto checkedSize = std::min(currentMessageSize, MessageSize);
auto& notif = notifications[writeIndex];
std::memcpy(notif.message.data(), message, checkedSize);
notif.message[checkedSize] = '\0';