summaryrefslogtreecommitdiff
path: root/src/components/ble/AlertNotificationService.cpp
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2020-12-01 20:44:44 (GMT)
committerGitHub <noreply@github.com>2020-12-01 20:44:44 (GMT)
commitc6556bcdea7671f1c1daaa9e20c4c3d7cd5f29a4 (patch)
tree38c920cd13ed3768af2363de317ef3adf4483bd6 /src/components/ble/AlertNotificationService.cpp
parentc87de415b28710ec0f5a504fe4720402b9be5ebc (diff)
parent6e22509b5ffe6d7c29d09b07f38e64fb1bdc0b21 (diff)
Merge pull request #136 from okaestne/include-cleanup
Includes cleanup
Diffstat (limited to 'src/components/ble/AlertNotificationService.cpp')
-rw-r--r--src/components/ble/AlertNotificationService.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/components/ble/AlertNotificationService.cpp b/src/components/ble/AlertNotificationService.cpp
index 32711b9..3156470 100644
--- a/src/components/ble/AlertNotificationService.cpp
+++ b/src/components/ble/AlertNotificationService.cpp
@@ -1,10 +1,9 @@
-
-#include <hal/nrf_rtc.h>
-#include "NotificationManager.h"
-#include <systemtask/SystemTask.h>
-
#include "AlertNotificationService.h"
+#include <hal/nrf_rtc.h>
#include <cstring>
+#include <algorithm>
+#include "NotificationManager.h"
+#include "systemtask/SystemTask.h"
using namespace Pinetime::Controllers;
@@ -60,8 +59,8 @@ int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle
const auto maxBufferSize{maxMessageSize + headerSize};
const auto dbgPacketLen = OS_MBUF_PKTLEN(ctxt->om);
- size_t bufferSize = min(dbgPacketLen + stringTerminatorSize, maxBufferSize);
- auto messageSize = min(maxMessageSize, (bufferSize-headerSize));
+ size_t bufferSize = std::min(dbgPacketLen + stringTerminatorSize, maxBufferSize);
+ auto messageSize = std::min(maxMessageSize, (bufferSize-headerSize));
NotificationManager::Notification notif;
os_mbuf_copydata(ctxt->om, headerSize, messageSize-1, notif.message.data());