High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 303:a0d78cb2e9ef, committed 2015-03-02
- Comitter:
- rgrover1
- Date:
- Mon Mar 02 11:50:48 2015 +0000
- Parent:
- 302:8f4348c2b6b5
- Child:
- 304:30618b2c9808
- Commit message:
- Synchronized with git rev 70f09d4c
Author: Rohit Grover
#32: minor enhancement. add enum UUID_Type_t to constrain 'type'.
Changed in this revision
public/UUID.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/UUID.h Mon Mar 02 11:50:48 2015 +0000 +++ b/public/UUID.h Mon Mar 02 11:50:48 2015 +0000 @@ -25,7 +25,7 @@ class UUID { public: - enum { + enum UUID_Type_t { UUID_TYPE_SHORT = 0, // Short BLE UUID UUID_TYPE_LONG = 1 // Full 128-bit UUID }; @@ -35,10 +35,13 @@ UUID(ShortUUIDBytes_t); public: - uint8_t shortOrLong(void) const {return type; } + UUID_Type_t shortOrLong(void) const {return type; } const uint8_t *getBaseUUID(void) const { - if (type == UUID_TYPE_SHORT) { return (const uint8_t*)&shortUUID; } - else { return baseUUID; } + if (type == UUID_TYPE_SHORT) { + return (const uint8_t*)&shortUUID; + } else { + return baseUUID; + } } ShortUUIDBytes_t getShortUUID(void) const {return shortUUID;} uint8_t getLen(void) const { @@ -48,7 +51,7 @@ bool operator== (const UUID&) const; private: - uint8_t type; // UUID_TYPE_SHORT or UUID_TYPE_LONG + UUID_Type_t type; // UUID_TYPE_SHORT or UUID_TYPE_LONG LongUUIDBytes_t baseUUID; /* the base of the long UUID (if * used). Note: bytes 12 and 13 (counting from LSB) * are zeroed out to allow comparison with other long