diff options
author | JF002 <JF002@users.noreply.github.com> | 2020-10-27 21:57:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 21:57:48 +0100 |
commit | cb9e8815d8bc6ce71fd8e97f3e3dae402658ce1f (patch) | |
tree | 1750edfed02f547102e468eca485caab3b08e98d /src/components/ble/ImmediateAlertService.cpp | |
parent | c5bf09d21b2ed8e2435ec625e351594f58713924 (diff) | |
parent | 7de43a16608e599369867cb3cfa7d5776a5b6380 (diff) |
Merge pull request #108 from JF002/notification-ui
Improved notification UI
Diffstat (limited to 'src/components/ble/ImmediateAlertService.cpp')
-rw-r--r-- | src/components/ble/ImmediateAlertService.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp index 3b7f47bf..e2cee308 100644 --- a/src/components/ble/ImmediateAlertService.cpp +++ b/src/components/ble/ImmediateAlertService.cpp @@ -1,4 +1,5 @@ #include <systemtask/SystemTask.h> +#include <cstring> #include "ImmediateAlertService.h" #include "AlertNotificationService.h" @@ -67,7 +68,12 @@ int ImmediateAlertService::OnAlertLevelChanged(uint16_t connectionHandle, uint16 if(context->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { auto alertLevel = static_cast<Levels>(context->om->om_data[0]); auto* alertString = ToString(alertLevel); - notificationManager.Push(Pinetime::Controllers::NotificationManager::Categories::SimpleAlert, alertString, strlen(alertString)); + + NotificationManager::Notification notif; + std::memcpy(notif.message.data(), alertString, strlen(alertString)); + notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert; + notificationManager.Push(std::move(notif)); + systemTask.PushMessage(Pinetime::System::SystemTask::Messages::OnNewNotification); } } |