diff options
| author | JF <jf@codingfield.com> | 2021-01-04 18:56:56 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-01-04 18:56:56 (GMT) |
| commit | 1d940af924bac5728a4d494f780e298e5b67b707 (patch) | |
| tree | 24540888f3d038ca3c88a0789b63faa8ac07d631 /src/components/ble/AlertNotificationService.cpp | |
| parent | 04abc91f157f5925ffa404728291a69893acf8cf (diff) | |
| parent | 50ae0ae5e073ac48652e6c26549f9b19655e8da3 (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/components/ble/AlertNotificationService.cpp')
| -rw-r--r-- | src/components/ble/AlertNotificationService.cpp | 13 |
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()); |
