High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Diff: UUID.cpp
- Revision:
- 53:a1bec483c8e3
- Parent:
- 50:9078969e80e4
- Child:
- 60:de30b62ab8c1
--- a/UUID.cpp Wed May 28 17:24:30 2014 +0100 +++ b/UUID.cpp Thu May 29 08:16:31 2014 +0100 @@ -121,70 +121,3 @@ UUID::~UUID(void) { } - -/**************************************************************************/ -/*! - @brief Updates the value of the UUID - - @args[in] uuid_base - The 128-bit value to use when updating the UUID. For - 16-bit IDs, insert the ID in bytes 2/3 in LSB format. - - @returns BLE_ERROR_NONE (0) if everything executed correctly, or an - error code if there was a problem - @retval BLE_ERROR_NONE - Everything executed correctly - - @section EXAMPLE - - @code - - @endcode -*/ -/**************************************************************************/ -ble_error_t UUID::update(uint8_t const uuid_base[LENGTH_OF_LONG_UUID]) -{ - memcpy(base, uuid_base, LENGTH_OF_LONG_UUID); - value = (uint16_t)((uuid_base[3] << 8) | (uuid_base[2])); - - /* Check if this is a short of a long UUID */ - if (uuid_base[0] + uuid_base[1] + - uuid_base[4] + uuid_base[5] + uuid_base[6] + uuid_base[7] + - uuid_base[8] + uuid_base[9] + uuid_base[10] + uuid_base[11] + - uuid_base[12] + uuid_base[13] + uuid_base[14] + uuid_base[15] == 0) { - type = UUID_TYPE_SHORT; - } else { - type = UUID_TYPE_LONG; - } - - return BLE_ERROR_NONE; -} - -/**************************************************************************/ -/*! - @brief Updates the value of the UUID - - @args[in] ble_uuid - The 16-bit value to use when updating the UUID. - - @returns BLE_ERROR_NONE (0) if everything executed correctly, or an - error code if there was a problem - @retval BLE_ERROR_NONE - Everything executed correctly - - @section EXAMPLE - - @code - - @endcode -*/ -/**************************************************************************/ -ble_error_t UUID::update(uint16_t const ble_uuid) -{ - memset(base, 0, LENGTH_OF_LONG_UUID); - memcpy(base + 2, (uint8_t *)&ble_uuid, 2); - value = ble_uuid; - type = UUID_TYPE_SHORT; - - return BLE_ERROR_NONE; -}