summaryrefslogtreecommitdiff
path: root/src/components/ble/AlertNotificationClient.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-04-04 10:10:47 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-04-04 10:10:47 (GMT)
commit03de1c67393fcb99b5987514be6f470349c57c0f (patch)
tree5eacb0614b667ff62f417c390109482ed7e0a07d /src/components/ble/AlertNotificationClient.cpp
parent58a2d000c4d49d96121894d6dd6bb861d7564bea (diff)
Add support for notification title. The notification buffer must contain the title and the message separated by a '\0' character.
If the buffer does not contain any \0, the whole buffer is considered to be the message of the notification. A default title will be displayed in the notification app.
Diffstat (limited to 'src/components/ble/AlertNotificationClient.cpp')
-rw-r--r--src/components/ble/AlertNotificationClient.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/components/ble/AlertNotificationClient.cpp b/src/components/ble/AlertNotificationClient.cpp
index e7a1862..cfb3272 100644
--- a/src/components/ble/AlertNotificationClient.cpp
+++ b/src/components/ble/AlertNotificationClient.cpp
@@ -165,6 +165,7 @@ void AlertNotificationClient::OnNotification(ble_gap_event *event) {
NotificationManager::Notification notif;
os_mbuf_copydata(event->notify_rx.om, headerSize, messageSize - 1, notif.message.data());
notif.message[messageSize - 1] = '\0';
+ notif.size = messageSize;
notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert;
notificationManager.Push(std::move(notif));