High level Bluetooth Low Energy API and radio abstraction layer

Dependents:   BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more

Overview

The BLE_API is a high level abstraction for using Bluetooth Low Energy on multiple platforms. For details and examples using the BLE_API please see the BLE_API Summary Page. Or click on the API Documentation tab above.

Supported Services

Supported services can be found in the BLE_API/services folder.

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Thu Dec 10 09:15:04 2015 +0000
Parent:
1034:947f5cf8884f
Child:
1036:7af23cdcfcac
Commit message:
Synchronized with git rev 01eaeeee
Author: Marcus Chang
Added bit ordering parameter to UUID construction.

Changed in this revision

DOXYGEN_FRONTPAGE.md Show annotated file Show diff for this revision Revisions of this file
ble.doxyfile Show annotated file Show diff for this revision Revisions of this file
ble/DiscoveredCharacteristic.h Show annotated file Show diff for this revision Revisions of this file
ble/DiscoveredService.h Show annotated file Show diff for this revision Revisions of this file
ble/Gap.h Show annotated file Show diff for this revision Revisions of this file
ble/UUID.h Show annotated file Show diff for this revision Revisions of this file
ble/services/EnvironmentalService.h Show annotated file Show diff for this revision Revisions of this file
ble/services/HealthThermometerService.h Show annotated file Show diff for this revision Revisions of this file
ble/services/HeartRateService.h Show annotated file Show diff for this revision Revisions of this file
module.json Show annotated file Show diff for this revision Revisions of this file
--- a/DOXYGEN_FRONTPAGE.md	Thu Dec 10 09:15:04 2015 +0000
+++ b/DOXYGEN_FRONTPAGE.md	Thu Dec 10 09:15:04 2015 +0000
@@ -4,7 +4,8 @@
 Bluetooth Low Energy on multiple platforms.
 
 This documentation describes the internal structure of the mbed
-[BLE API](https://github.com/armmbed/ble).
+[BLE API](https://github.com/armmbed/ble). It was automatically generated from
+specially formatted comment blocks in BLE API's source code using Doxygen (see http://www.stack.nl/~dimitri/doxygen/ for more information on Doxygen).
 
 For getting started with BLE on mbed, check our [introduction
 page](https://docs.mbed.com/docs/ble-intros/en/latest/).
--- a/ble.doxyfile	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble.doxyfile	Thu Dec 10 09:15:04 2015 +0000
@@ -131,7 +131,7 @@
 # path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.
 
-FULL_PATH_NAMES        = YES
+FULL_PATH_NAMES        = NO
 
 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
 # can be used to strip a user-defined part of the path. Stripping is
@@ -165,7 +165,7 @@
 # comments will behave just like regular Qt-style comments
 # (thus requiring an explicit @brief command for a brief description.)
 
-JAVADOC_AUTOBRIEF      = NO
+JAVADOC_AUTOBRIEF      = YES
 
 # If the QT_AUTOBRIEF tag is set to YES then Doxygen will
 # interpret the first line (until the first dot) of a Qt-style
@@ -245,21 +245,15 @@
 # Doxygen selects the parser to use depending on the extension of the files it
 # parses. With this tag you can assign which parser to use for a given
 # extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
+# using this tag. The format is ext=language, where ext is a file extension,
+# and language is one of the parsers supported by doxygen: IDL, Java,
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
+# C++. For instance to make doxygen treat .inc files as Fortran files (default
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the
+# files are not read by doxygen.
 
-EXTENSION_MAPPING      = h=C++
+EXTENSION_MAPPING      =
 
 # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
 # comments according to the Markdown format, which allows for more readable
@@ -367,12 +361,12 @@
 # Private class members and static file members will be hidden unless
 # the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES
 
-EXTRACT_ALL            = NO
+EXTRACT_ALL            = YES
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
-EXTRACT_PRIVATE        = NO
+EXTRACT_PRIVATE        = YES
 
 # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
 # scope will be included in the documentation.
@@ -382,7 +376,7 @@
 # If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
 
-EXTRACT_STATIC         = NO
+EXTRACT_STATIC         = YES
 
 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
 # defined locally in source files will be included in the documentation.
@@ -395,7 +389,7 @@
 # the interface are included in the documentation.
 # If set to NO (the default) only methods in the interface are included.
 
-EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_LOCAL_METHODS  = YES
 
 # If this flag is set to YES, the members of anonymous namespaces will be
 # extracted and appear in the documentation as a namespace called
@@ -494,7 +488,7 @@
 # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
 # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
 
-SORT_MEMBERS_CTORS_1ST = YES
+SORT_MEMBERS_CTORS_1ST = NO
 
 # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
 # hierarchy of group names into alphabetical order. If set to NO (the default)
@@ -644,7 +638,7 @@
 # wrong or incomplete parameter documentation, but not about the absence of
 # documentation.
 
-WARN_NO_PARAMDOC       = YES
+WARN_NO_PARAMDOC       = NO
 
 # The WARN_FORMAT tag determines the format of the warning messages that
 # doxygen can produce. The string should contain the $file, $line, and $text
@@ -659,10 +653,10 @@
 # and error messages should be written. If left blank the output is written
 # to stderr.
 
-WARN_LOGFILE           = doxygen_warn.log
+WARN_LOGFILE           =
 
 #---------------------------------------------------------------------------
-# Configuration options related to the input files
+# configuration options related to the input files
 #---------------------------------------------------------------------------
 
 # The INPUT tag can be used to specify the files and/or directories that contain
@@ -737,7 +731,7 @@
 # and *.h) to filter out the source-files in the directories. If left
 # blank all files are included.
 
-EXAMPLE_PATTERNS       =
+EXAMPLE_PATTERNS       = *
 
 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
 # searched for input files to be used with the \include or \dontinclude
@@ -839,16 +833,6 @@
 
 REFERENCES_LINK_SOURCE = YES
 
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS        = YES
-
 # If the USE_HTAGS tag is set to YES then the references to source code
 # will point to the HTML generated by the htags(1) tool instead of doxygen
 # built-in source browser. The htags tool is part of GNU's global source
@@ -871,7 +855,7 @@
 # of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
-ALPHABETICAL_INDEX     = YES
+ALPHABETICAL_INDEX     = NO
 
 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
@@ -887,7 +871,7 @@
 IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
-# Configuration options related to the HTML output
+# configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_HTML tag is set to YES (the default) Doxygen will
@@ -1147,11 +1131,9 @@
 
 GENERATE_ECLIPSEHELP   = NO
 
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
 
 ECLIPSE_DOC_ID         = org.doxygen.Project
 
@@ -1255,7 +1237,7 @@
 # typically be disabled. For large projects the javascript based search engine
 # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
 
-SEARCHENGINE           = YES
+SEARCHENGINE           = NO
 
 # When the SERVER_BASED_SEARCH tag is enabled the search engine will be
 # implemented using a web server instead of a web client using Javascript.
@@ -1291,11 +1273,10 @@
 
 SEARCHDATA_FILE        = searchdata.xml
 
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
 # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
 # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
 # projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
 
 EXTERNAL_SEARCH_ID     =
 
@@ -1309,7 +1290,7 @@
 EXTRA_SEARCH_MAPPINGS  =
 
 #---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
+# configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
@@ -1415,7 +1396,7 @@
 LATEX_BIB_STYLE        = plain
 
 #---------------------------------------------------------------------------
-# Configuration options related to the RTF output
+# configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
@@ -1704,7 +1685,7 @@
 # this option also works with HAVE_DOT disabled, but it is recommended to
 # install and use dot, since it yields more powerful graphs.
 
-CLASS_DIAGRAMS         = YES
+CLASS_DIAGRAMS         = NO
 
 # You can define message sequence charts within doxygen comments using the \msc
 # command. Doxygen will then run the mscgen tool (see
--- a/ble/DiscoveredCharacteristic.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/DiscoveredCharacteristic.h	Thu Dec 10 09:15:04 2015 +0000
@@ -137,13 +137,13 @@
      */
     ble_error_t write(uint16_t length, const uint8_t *value) const;
 
-    /** 
+    /**
      * Same as above but register the callback wich will be called once the data has been written
      */
     ble_error_t write(uint16_t length, const uint8_t *value, const GattClient::WriteCallback_t& onRead) const;
 
-    void setupLongUUID(UUID::LongUUIDBytes_t longUUID) {
-        uuid.setupLong(longUUID);
+    void setupLongUUID(UUID::LongUUIDBytes_t longUUID, UUID::BitOrder_t order = UUID::MSB) {
+        uuid.setupLong(longUUID, order);
     }
 
 public:
--- a/ble/DiscoveredService.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/DiscoveredService.h	Thu Dec 10 09:15:04 2015 +0000
@@ -36,8 +36,8 @@
          endHandle   = endHandleIn;
      }
 
-    void setupLongUUID(UUID::LongUUIDBytes_t longUUID) {
-         uuid.setupLong(longUUID);
+    void setupLongUUID(UUID::LongUUIDBytes_t longUUID, UUID::BitOrder_t order = UUID::MSB) {
+         uuid.setupLong(longUUID, order);
     }
 
 public:
--- a/ble/Gap.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/Gap.h	Thu Dec 10 09:15:04 2015 +0000
@@ -183,16 +183,14 @@
     }
 
     /**
-     * @return Minimum Advertising interval in milliseconds for connectable
-     *      undirected and connectable directed event types.
+     * @return Minimum Advertising interval in milliseconds.
      */
     virtual uint16_t getMinAdvertisingInterval(void) const {
         return 0; /* Requesting action from porter(s): override this API if this capability is supported. */
     }
 
     /**
-     * @return Minimum Advertising interval in milliseconds for scannable
-     *      undirected and non-connectable undirected event types.
+     * @return Minimum Advertising interval in milliseconds for non-connectible mode.
      */
     virtual uint16_t getMinNonConnectableAdvertisingInterval(void) const {
         return 0; /* Requesting action from porter(s): override this API if this capability is supported. */
@@ -466,6 +464,11 @@
      * peripheral faster, at the expense of more power being used by the radio
      * due to the higher data transmit rate.
      *
+     * @note: This API is now *deprecated* and will be dropped in the future.
+     * You should use the parallel API from Gap directly. A former call to
+     * ble.setAdvertisingInterval(...) should now be achieved using
+     * ble.gap().setAdvertisingInterval(...).
+     *
      * @Note: [WARNING] This API previously used 0.625ms as the unit for its
      * 'interval' argument. That required an explicit conversion from
      * milliseconds using Gap::MSEC_TO_GAP_DURATION_UNITS(). This conversion is
--- a/ble/UUID.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/UUID.h	Thu Dec 10 09:15:04 2015 +0000
@@ -22,6 +22,18 @@
 
 #include "blecommon.h"
 
+static uint8_t char2int(char c) {
+    if ((c >= '0') && (c <= '9')) {
+        return c - '0';
+    } else if ((c >= 'a') && (c <= 'f')) {
+        return c - 'a' + 10;
+    } else if ((c >= 'A') && (c <= 'F')) {
+        return c - 'A' + 10;
+    } else {
+        return 0;
+    }
+}
+
 class UUID {
 public:
     enum UUID_Type_t {
@@ -29,12 +41,72 @@
         UUID_TYPE_LONG  = 1     // Full 128-bit UUID.
     };
 
+    typedef enum {
+        MSB,
+        LSB
+    } BitOrder_t;
+
     typedef uint16_t      ShortUUIDBytes_t;
 
     static const unsigned LENGTH_OF_LONG_UUID = 16;
     typedef uint8_t       LongUUIDBytes_t[LENGTH_OF_LONG_UUID];
 
+    static const unsigned MAX_UUID_STRING_LENGTH = LENGTH_OF_LONG_UUID * 2 + 4;
+
 public:
+
+    /**
+     * Creates a new 128-bit UUID.
+     *
+     * @note   The UUID is a unique 128-bit (16 byte) ID used to identify
+     *         different service or characteristics on the BLE device.
+     *
+     * @param  stringUUID
+     *          The 128-bit (16-byte) UUID as a human readable const-string.
+     *          Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
+     *          Upper and lower case supported. Hyphens are optional, but only
+     *          upto four of them. The UUID is stored internally as a 16 byte
+     *          array, LSB (little endian), which is opposite from the string.
+     */
+    UUID(const char* stringUUID) : type(UUID_TYPE_LONG), baseUUID(), shortUUID(0) {
+        bool nibble = false;
+        uint8_t byte = 0;
+        size_t baseIndex = 0;
+        uint8_t tempUUID[LENGTH_OF_LONG_UUID];
+
+        // Iterate through string, abort if NULL is encountered prematurely.
+        // Ignore upto four hyphens.
+        for (size_t index = 0; (index < MAX_UUID_STRING_LENGTH) && (baseIndex < LENGTH_OF_LONG_UUID); index++) {
+            if (stringUUID[index] == '\0') {
+                // error abort
+                break;
+            } else if (stringUUID[index] == '-') {
+                // ignore hyphen
+                continue;
+            } else if (nibble) {
+                // got second nibble
+                byte |= char2int(stringUUID[index]);
+                nibble = false;
+
+                // store copy
+                tempUUID[baseIndex++] = byte;
+            } else {
+                // got first nibble
+                byte = char2int(stringUUID[index]) << 4;
+                nibble = true;
+            }
+        }
+
+        // populate internal variables if string was successfully parsed
+        if (baseIndex == LENGTH_OF_LONG_UUID) {
+            setupLong(tempUUID, UUID::MSB);
+        } else {
+            const uint8_t sig[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
+                                    0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB };
+            setupLong(sig, UUID::MSB);
+        }
+    }
+
     /**
      * Creates a new 128-bit UUID.
      *
@@ -42,10 +114,12 @@
      *         different service or characteristics on the BLE device.
      *
      * @param longUUID
-     *          The 128-bit (16-byte) UUID value, MSB first (big-endian).
+     *          The 128-bit (16-byte) UUID value.
+     * @param order
+     *          The bit order of the UUID, MSB by default.
      */
-    UUID(const LongUUIDBytes_t longUUID) : type(UUID_TYPE_LONG), baseUUID(), shortUUID(0) {
-        setupLong(longUUID);
+    UUID(const LongUUIDBytes_t longUUID, BitOrder_t order = UUID::MSB) : type(UUID_TYPE_LONG), baseUUID(), shortUUID(0) {
+        setupLong(longUUID, order);
     }
 
     /**
@@ -91,10 +165,17 @@
     /**
      * Fill in a 128-bit UUID; this is useful when the UUID isn't known at the time of the object construction.
      */
-    void setupLong(const LongUUIDBytes_t longUUID) {
+    void setupLong(const LongUUIDBytes_t longUUID, BitOrder_t order = UUID::MSB) {
         type      = UUID_TYPE_LONG;
-        memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
-        shortUUID = (uint16_t)((longUUID[2] << 8) | (longUUID[3]));
+        if (order == UUID::MSB) {
+            // Switch endian. Input is big-endian, internal representation is little endian.
+            for (size_t index = 0; index < LENGTH_OF_LONG_UUID; index++) {
+                baseUUID[LENGTH_OF_LONG_UUID - 1 - index] = longUUID[index];
+            }
+        } else {
+            memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
+        }
+        shortUUID = (uint16_t)((baseUUID[13] << 8) | (baseUUID[12]));
     }
 
 public:
@@ -132,12 +213,8 @@
 
 private:
     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
-                            * UUIDs, which differ only in the 16-bit relative
-                            * part.*/
-    ShortUUIDBytes_t shortUUID; // 16 bit UUID (byte 2-3 using with base).
+    LongUUIDBytes_t  baseUUID;  // The long UUID
+    ShortUUIDBytes_t shortUUID; // 16 bit UUID
 };
 
 #endif // ifndef __UUID_H__
\ No newline at end of file
--- a/ble/services/EnvironmentalService.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/services/EnvironmentalService.h	Thu Dec 10 09:15:04 2015 +0000
@@ -21,10 +21,10 @@
 
 /**
 * @class EnvironmentalService
-* @brief BLE Environmental Service. This service provides temperature, humidity and pressure measurement.
-* Service:  https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.environmental_sensing.xml
-* Temperature: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature.xml
-* Humidity: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.humidity.xml
+* @brief BLE Environmental Service. This service provides the location of the thermometer and the temperature.  <br>
+* Service:  https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.environmental_sensing.xml <br>
+* Temperature: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature.xml <br>
+* Humidity: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.humidity.xml <br>
 * Pressure: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.pressure.xml
 */
 class EnvironmentalService {
--- a/ble/services/HealthThermometerService.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/services/HealthThermometerService.h	Thu Dec 10 09:15:04 2015 +0000
@@ -21,34 +21,34 @@
 
 /**
 * @class HealthThermometerService
-* @brief BLE Health Thermometer Service. This service provides the location of the thermometer and the temperature.
-* Service:  https://developer.bluetooth.org/gatt/profiles/Pages/ProfileViewer.aspx?u=org.bluetooth.profile.health_thermometer.xml
-* Temperature Measurement: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_measurement.xml
+* @brief BLE Health Thermometer Service. This service provides the location of the thermometer and the temperature.  <br>
+* Service:  https://developer.bluetooth.org/gatt/profiles/Pages/ProfileViewer.aspx?u=org.bluetooth.profile.health_thermometer.xml <br>
+* Temperature Measurement: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_measurement.xml <br>
 * Temperature Type: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_type.xml
 */
 class HealthThermometerService {
 public:
     /**
-    * @enum Sensor Location.
-    * @brief Location of sensor on the body.
+    * @enum Sensor Location
+    * @brief Location of sensor on the body
     */
     enum SensorLocation_t {
-        LOCATION_ARMPIT = 1,    /*!< Armpit. */
-        LOCATION_BODY,          /*!< Body. */
-        LOCATION_EAR,           /*!< Ear. */
-        LOCATION_FINGER,        /*!< Finger. */
+        LOCATION_ARMPIT = 1,    /*!< armpit */
+        LOCATION_BODY,          /*!< body */
+        LOCATION_EAR,           /*!< ear */
+        LOCATION_FINGER,        /*!< finger */
         LOCATION_GI_TRACT,      /*!< GI tract */
-        LOCATION_MOUTH,         /*!< Mouth. */
-        LOCATION_RECTUM,        /*!< Rectum. */
-        LOCATION_TOE,           /*!< Toe. */
-        LOCATION_EAR_DRUM,      /*!< Eardrum. */
+        LOCATION_MOUTH,         /*!< mouth */
+        LOCATION_RECTUM,        /*!< rectum */
+        LOCATION_TOE,           /*!< toe */
+        LOCATION_EAR_DRUM,      /*!< ear drum */
     };
 
 public:
     /**
-     * @brief Add the Health Thermometer Service to an existing BLE object, initialize with temperature and location.
-     * @param[ref] _ble         Reference to the BLE device.
-     * @param[in] initialTemp  Initial value in celsius.
+     * @brief Add the Health Thermometer Service to an existing ble object, initialize with temperature and location.
+     * @param[ref] _ble         reference to the BLE device
+     * @param[in] initialTemp  initial value in celsius
      * @param[in] _location
      */
     HealthThermometerService(BLE &_ble, float initialTemp, uint8_t _location) :
@@ -64,10 +64,10 @@
     }
 
     /**
-    * @brief Update the temperature being broadcast.
+    * @brief Update the temperature being broadcast
     *
     * @param[in] temperature
-    *                   Floating point value of the temperature.
+    *                   Floating point value of the temperature
     *
     */
     void updateTemperature(float temperature) {
@@ -80,14 +80,14 @@
     /**
      * @brief Update the location.
      * @param loc
-     *        New location value.
+     *        new location value.
      */
     void updateLocation(SensorLocation_t loc) {
         ble.gattServer().write(tempLocation.getValueHandle(), reinterpret_cast<uint8_t *>(&loc), sizeof(uint8_t));
     }
 
 private:
-    /* Private internal representation for the bytes used to work with the vaulue of the temperature characteristic. */
+    /* Private internal representation for the bytes used to work with the vaulue of the heart-rate characteristic. */
     struct TemperatureValueBytes {
         static const unsigned OFFSET_OF_FLAGS    = 0;
         static const unsigned OFFSET_OF_VALUE    = OFFSET_OF_FLAGS + sizeof(uint8_t);
@@ -101,7 +101,7 @@
         static const uint8_t  TEMPERATURE_UNITS_FAHRENHEIT = 1;
 
         TemperatureValueBytes(float initialTemperature) : bytes() {
-            /* Assumption: temperature values are expressed in celsius */
+            /* assumption: temperature values are expressed in Celsius */
             bytes[OFFSET_OF_FLAGS] =  (TEMPERATURE_UNITS_CELSIUS << TEMPERATURE_UNITS_FLAG_POS) |
                                       (false << TIMESTAMP_FLAG_POS) |
                                       (false << TEMPERATURE_TYPE_FLAG_POS);
@@ -128,15 +128,15 @@
          * @return The temperature in 11073-20601 FLOAT-Type format.
          */
         uint32_t quick_ieee11073_from_float(float temperature) {
-            uint8_t  exponent = 0xFE; //Exponent is -2
+            uint8_t  exponent = 0xFE; //exponent is -2
             uint32_t mantissa = (uint32_t)(temperature * 100);
 
             return (((uint32_t)exponent) << 24) | mantissa;
         }
 
 private:
-        /* First byte: 8-bit flags. Second field is a float holding the temperature value. */
-        /* See https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_measurement.xml */
+        /* First byte = 8-bit flags, Second field is a float holding the temperature value. */
+        /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.temperature_measurement.xml */
         uint8_t bytes[SIZEOF_VALUE_BYTES];
     };
 
--- a/ble/services/HeartRateService.h	Thu Dec 10 09:15:04 2015 +0000
+++ b/ble/services/HeartRateService.h	Thu Dec 10 09:15:04 2015 +0000
@@ -21,35 +21,35 @@
 
 /**
 * @class HeartRateService
-* @brief BLE Service for HeartRate. This BLE Service contains the location of the sensor and the heart rate in beats per minute.
-* Service:  https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml
-* HRM Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml
+* @brief BLE Service for HeartRate. This BLE Service contains the location of the sensor, the heartrate in beats per minute. <br>
+* Service:  https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml <br>
+* HRM Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml <br>
 * Location: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml
 */
 class HeartRateService {
 public:
     /**
     * @enum SensorLocation
-    * @brief Location of the heart rate sensor on body.
+    * @brief Location of HeartRate sensor on body.
     */
     enum {
-        LOCATION_OTHER = 0, /*!< Other location. */
-        LOCATION_CHEST,     /*!< Chest. */
-        LOCATION_WRIST,     /*!< Wrist. */
-        LOCATION_FINGER,    /*!< Finger. */
-        LOCATION_HAND,      /*!< Hand. */
-        LOCATION_EAR_LOBE,  /*!< Earlobe. */
-        LOCATION_FOOT,      /*!< Foot. */
+        LOCATION_OTHER = 0, /*!< Other Location */
+        LOCATION_CHEST,     /*!< Chest */
+        LOCATION_WRIST,     /*!< Wrist */
+        LOCATION_FINGER,    /*!< Finger */
+        LOCATION_HAND,      /*!< Hand */
+        LOCATION_EAR_LOBE,  /*!< Earlobe */
+        LOCATION_FOOT,      /*!< Foot */
     };
 
 public:
     /**
-     * @brief Constructor with 8-bit HRM Counter value.
+     * @brief Constructor with 8bit HRM Counter value.
      *
      * @param[ref] _ble
      *               Reference to the underlying BLE.
      * @param[in] hrmCounter (8-bit)
-     *               Initial value for the HRM counter.
+     *               initial value for the hrm counter.
      * @param[in] location
      *               Sensor's location.
      */
@@ -70,7 +70,7 @@
      * @param[in] _ble
      *               Reference to the underlying BLE.
      * @param[in] hrmCounter (8-bit)
-     *               Initial value for the HRM counter.
+     *               initial value for the hrm counter.
      * @param[in] location
      *               Sensor's location.
      */
@@ -86,10 +86,10 @@
     }
 
     /**
-     * @brief Set a new 8-bit value for the heart rate.
+     * @brief Set a new 8-bit value for heart rate.
      *
      * @param[in] hrmCounter
-     *                  Heart rate in BPM.
+     *                  HeartRate in bpm.
      */
     void updateHeartRate(uint8_t hrmCounter) {
         valueBytes.updateHeartRate(hrmCounter);
@@ -97,10 +97,10 @@
     }
 
     /**
-     * Set a new 16-bit value for the heart rate.
+     * Set a new 16-bit value for heart rate.
      *
      * @param[in] hrmCounter
-     *                  Heart rate in BPM.
+     *                  HeartRate in bpm.
      */
     void updateHeartRate(uint16_t hrmCounter) {
         valueBytes.updateHeartRate(hrmCounter);
@@ -108,8 +108,8 @@
     }
 
     /**
-     * This callback allows the heart rate service to receive updates to the
-     * controlPoint characteristic.
+     * This callback allows the HeartRateService to receive updates to the
+     * controlPoint Characteristic.
      *
      * @param[in] params
      *     Information about the characterisitc being updated.
@@ -118,7 +118,7 @@
         if (params->handle == controlPoint.getValueAttribute().getHandle()) {
             /* Do something here if the new value is 1; else you can override this method by
              * extending this class.
-             * @NOTE: If you are extending this class, be sure to also call
+             * @NOTE: if you are extending this class, be sure to also call
              * ble.onDataWritten(this, &ExtendedHRService::onDataWritten); in
              * your constructor.
              */
@@ -135,9 +135,9 @@
     }
 
 protected:
-    /* Private internal representation for the bytes used to work with the value of the heart rate characteristic. */
+    /* Private internal representation for the bytes used to work with the vaulue of the heart-rate characteristic. */
     struct HeartRateValueBytes {
-        static const unsigned MAX_VALUE_BYTES  = 3; /* Flags, and up to two bytes for heart rate. */
+        static const unsigned MAX_VALUE_BYTES  = 3; /* FLAGS + up to two bytes for heart-rate */
         static const unsigned FLAGS_BYTE_INDEX = 0;
 
         static const unsigned VALUE_FORMAT_BITNUM = 0;
@@ -175,8 +175,8 @@
         }
 
     private:
-        /* First byte: 8-bit values, no extra info. Second byte: uint8_t HRM value */
-        /* See https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */
+        /* First byte = 8-bit values, no extra info, Second byte = uint8_t HRM value */
+        /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */
         uint8_t valueBytes[MAX_VALUE_BYTES];
     };
 
--- a/module.json	Thu Dec 10 09:15:04 2015 +0000
+++ b/module.json	Thu Dec 10 09:15:04 2015 +0000
@@ -1,6 +1,6 @@
 {
   "name": "ble",
-  "version": "2.1.9",
+  "version": "2.1.7",
   "description": "The BLE module offers a high level abstraction for using Bluetooth Low Energy on multiple platforms.",
   "keywords": [
     "Bluetooth",