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.
Fork of BLE_API by
Diff: common/UUID.cpp
- Revision:
- 307:ecbc3405c66e
- Parent:
- 306:ae0df1c9222a
--- a/common/UUID.cpp Mon Mar 02 11:50:49 2015 +0000
+++ b/common/UUID.cpp Mon Mar 02 11:50:49 2015 +0000
@@ -66,24 +66,10 @@
@endcode
*/
/**************************************************************************/
-UUID::UUID(const LongUUIDBytes_t longUUID) : type(UUID_TYPE_SHORT), baseUUID(), shortUUID(0)
+UUID::UUID(const LongUUIDBytes_t longUUID) : type(UUID_TYPE_LONG), baseUUID(), shortUUID(0)
{
memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
shortUUID = (uint16_t)((longUUID[2] << 8) | (longUUID[3]));
-
- /* Check if this is a short of a long UUID */
- unsigned index;
- for (index = 0; index < LENGTH_OF_LONG_UUID; index++) {
- if ((index == 2) || (index == 3)) {
- continue; /* we should not consider bytes 2 and 3 because that's
- * where the 16-bit relative UUID is placed. */
- }
-
- if (baseUUID[index] != 0) {
- type = UUID_TYPE_LONG;
- return;
- }
- }
}
bool UUID::operator==(const UUID &other) const
