Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: LinkNode_SimpleChatwithSerial
Fork of BLE_API by
Diff: ble/UUID.h
- Revision:
- 1039:2ea9d52111e2
- Parent:
- 1038:ebf9746bff7d
diff -r ebf9746bff7d -r 2ea9d52111e2 ble/UUID.h
--- a/ble/UUID.h Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/UUID.h Thu Dec 10 09:15:04 2015 +0000
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <string.h>
+#include <algorithm>
#include "blecommon.h"
@@ -177,11 +178,9 @@
type = UUID_TYPE_LONG;
if (order == UUID::MSB) {
// Switch endian. Input is big-endian, internal representation is little endian.
- for (size_t index = 0; index < LENGTH_OF_LONG_UUID; index++) {
- baseUUID[LENGTH_OF_LONG_UUID - 1 - index] = longUUID[index];
- }
+ std::reverse_copy(longUUID, longUUID + LENGTH_OF_LONG_UUID, baseUUID);
} else {
- memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
+ std::copy(longUUID, longUUID + LENGTH_OF_LONG_UUID, baseUUID);
}
shortUUID = (uint16_t)((baseUUID[13] << 8) | (baseUUID[12]));
}
