change BLEUuid.size() to return number of bits instead of bytes

This commit is contained in:
hathach committed 2017-03-22 15:02:44 +07:00
1 parent 98402b1a50
commit 9ca48429cf
3 files changed
+10 -6

No files matched your search

+7 -3
View File
@@ -54,11 +54,15 @@ void BLEUuid::get(uint16_t& uuid16 )
}
uint8_t BLEUuid::size (void) const
/**
* Get size of uuid in BIT
* @return 16, 32 or 128
*/
size_t BLEUuid::size (void) const
{
// uuid 16
if (_uuid.type == BLE_UUID_TYPE_BLE ) return 2;
if (_uuid128 != NULL ) return 16;
if (_uuid.type == BLE_UUID_TYPE_BLE ) return 16;
if (_uuid128 != NULL || _uuid.type >= BLE_UUID_TYPE_VENDOR_BEGIN) return 128;
// unknown
return 0;