Copy edit UUID.h

Copy edit, mostly for consistent tense and consistent use of hyphens.
pull/5392/head
Amanda Butler 2017-11-07 17:00:34 -06:00 committed by GitHub
parent 71bc3f74da
commit 1720a484dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 28 deletions

View File

@ -54,21 +54,21 @@ static uint8_t char2int(char c)
/** /**
* Representation of a Universally Unique Identifier (UUID). * Representation of a Universally Unique Identifier (UUID).
* *
* UUIDs are 128 bits wide number used to identify data type and elements in * UUIDs are 128-bit wide numbers used to identify data type and elements in
* many layers of the Bluetooth specification. * many layers of the Bluetooth specification.
* *
* Two representations of UUIDS exist: * Two representations of UUIDS exist:
* - 16 bits UUIDs: Shortened representation of the 128 bit UUID * - 16-bit UUIDs: Shortened representation of the 128 bit UUID
* 0000xxxx-0000-1000-8000-00805F9B34FB where xxxx is the 16 bit UUID. * 0000xxxx-0000-1000-8000-00805F9B34FB where xxxx is the 16 bit UUID.
* Values of those UUIDs are defined by the Bluetooth body. The short * Values of those UUIDs are defined by the Bluetooth body. The short
* representation save bandwidth during protocol transactions. * representation saves bandwidth during protocol transactions.
* - 128 bits UUIDs: Complete representation of an UUID. They are commonly * - 128-bit UUIDs: Complete representation of a UUID. They are commonly
* used for user defined UUID. * used for user defined UUID.
* *
* This class act as an adapter over these two kind of UUIDs to allow * This class acts as an adapter over these two kinds of UUIDs to allow
* indiscriminate usage of both forms in mbed BLE APIs . * indiscriminate use of both forms in Mbed BLE APIs.
* *
* @note 32 bits UUID representation is not supported at the current moment. * @note 32-bit UUID representation is not supported currently.
*/ */
class UUID { class UUID {
public: public:
@ -91,16 +91,16 @@ public:
/** /**
* Enumeration of byte ordering. * Enumeration of byte ordering.
* *
* It is used to construct 128 byte UUIDs. * It is used to construct 128-byte UUIDs.
*/ */
typedef enum { typedef enum {
/** /**
* Most-significant byte first (at the smallest address). * Most significant byte first (at the smallest address).
*/ */
MSB, MSB,
/** /**
* Least-significant byte first (at the smallest address). * Least significant byte first (at the smallest address).
*/ */
LSB LSB
} ByteOrder_t; } ByteOrder_t;
@ -140,8 +140,8 @@ public:
* @note Upper and lower case are supported. * @note Upper and lower case are supported.
* @note Hyphens are optional. The string must include at most four hyphens. * @note Hyphens are optional. The string must include at most four hyphens.
* *
* @note Internally the UUID is stored in the little endian order as a 16 * @note Internally, the UUID is stored in the little endian order as a
* byte array. * 16-byte array.
*/ */
UUID(const char* stringUUID) : UUID(const char* stringUUID) :
type(UUID_TYPE_LONG), type(UUID_TYPE_LONG),
@ -154,8 +154,8 @@ public:
uint8_t tempUUID[LENGTH_OF_LONG_UUID]; uint8_t tempUUID[LENGTH_OF_LONG_UUID];
/* /*
* Iterate through string, abort if NULL is encountered prematurely. * Iterate through string; abort if NULL is encountered prematurely.
* Ignore upto four hyphens. * Ignore up to four hyphens.
*/ */
for (size_t index = 0; (index < MAX_UUID_STRING_LENGTH) && (baseIndex < LENGTH_OF_LONG_UUID); index++) { for (size_t index = 0; (index < MAX_UUID_STRING_LENGTH) && (baseIndex < LENGTH_OF_LONG_UUID); index++) {
if (stringUUID[index] == '\0') { if (stringUUID[index] == '\0') {
@ -189,7 +189,7 @@ public:
} }
/** /**
* Construct a new UUID from a 128-bits representation. * Construct a new UUID from a 128-bit representation.
* *
* @param[in] longUUID The 128-bit (16-byte) of the UUID value. * @param[in] longUUID The 128-bit (16-byte) of the UUID value.
* @param[in] order Bytes order of @p longUUID. * @param[in] order Bytes order of @p longUUID.
@ -201,17 +201,17 @@ public:
/** /**
* Creates a new 16-bit UUID. * Creates a new 16-bit UUID.
* *
* 16 bit wide UUIDs are defined by the Bluetoth standard body and are the * The Bluetooth standard body defines 16-bit wide UUIDs. They are the
* shortened version of the UUID 0000xxxx-0000-1000-8000-00805F9B34FB where * shortened version of the UUID 0000xxxx-0000-1000-8000-00805F9B34FB, where
* xxxx represent is the value of the 16 bit UUID. * xxxx is the value of the 16-bit UUID.
* *
* @important 16 bit UUIDs shall not be used in user defined data type or * @important 16-bit UUIDs are not used in user defined data type or
* user defined element ID. * user defined element ID.
* *
* @param[in] _shortUUID 16 bit part of the standard UUID. * @param[in] _shortUUID 16-bit part of the standard UUID.
* The short UUID value. * The short UUID value.
* *
* @note User defined UUID are commonly named vendor-specific UUIDs across * @note User defined UUIDs are commonly named vendor-specific UUIDs across
* the Bluetooth literature. * the Bluetooth literature.
*/ */
UUID(ShortUUIDBytes_t _shortUUID) : UUID(ShortUUIDBytes_t _shortUUID) :
@ -246,9 +246,9 @@ public:
} }
/** /**
* Replace existing value with a 128 bit UUID. * Replace existing value with a 128-bit UUID.
* *
* @param[in] longUUID New 16 byte wide UUID value. * @param[in] longUUID New 16-byte wide UUID value.
* @param[in] order Byte ordering of @p longUUID. * @param[in] order Byte ordering of @p longUUID.
*/ */
void setupLong(const LongUUIDBytes_t longUUID, ByteOrder_t order = UUID::MSB) void setupLong(const LongUUIDBytes_t longUUID, ByteOrder_t order = UUID::MSB)
@ -270,8 +270,8 @@ public:
/** /**
* Return the internal type of the UUID. * Return the internal type of the UUID.
* *
* @return UUID_TYPE_SHORT if the UUID is 16 bit wide. * @return UUID_TYPE_SHORT if the UUID is 16-bit wide.
* @return UUID_TYPE_LONG if the UUID is 128 bit wide. * @return UUID_TYPE_LONG if the UUID is 128-bit wide.
*/ */
UUID_Type_t shortOrLong(void) const UUID_Type_t shortOrLong(void) const
{ {
@ -281,8 +281,8 @@ public:
/** /**
* Get a pointer to the UUID value based on the current UUID type. * Get a pointer to the UUID value based on the current UUID type.
* *
* @return A pointer to an uint16_t object if the UUID is 16 bit long. * @return A pointer to an uint16_t object if the UUID is 16 bits long.
* @return A pointer to an array of 16 bytes if the UUID is 128 bit long. * @return A pointer to an array of 16 bytes if the UUID is 128 bits long.
*/ */
const uint8_t *getBaseUUID(void) const const uint8_t *getBaseUUID(void) const
{ {
@ -296,7 +296,7 @@ public:
/** /**
* Get the uint16_t value of the UUID. * Get the uint16_t value of the UUID.
* *
* @important This function shall not be used on long UUIDs. * @important This function is not used on long UUIDs.
* *
* @return The value of the shortened UUID. * @return The value of the shortened UUID.
*/ */