High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 19:a6f33421746c, committed 2013-12-18
- Comitter:
- ktownsend
- Date:
- Wed Dec 18 20:11:45 2013 +0000
- Parent:
- 18:86fe1e247a54
- Child:
- 20:c6ceaa206674
- Commit message:
- A few more doxygen improvements
Changed in this revision
--- a/GapAdvertisingData.h Wed Dec 18 19:39:19 2013 +0000 +++ b/GapAdvertisingData.h Wed Dec 18 20:11:45 2013 +0000 @@ -56,8 +56,19 @@ class GapAdvertisingData { public: - /* Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 11, 18 */ - /* https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile */ + /**********************************************************************/ + /*! + \brief + A list of Advertising Data types commonly used by peripherals. + These AD types are used to describe the capabilities of the + peripheral, and get inserted inside the advertising or scan + response payloads. + + \par Source + \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 11, 18 + \li \c https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile + */ + /**********************************************************************/ enum DataType { FLAGS = 0x01, @@ -78,19 +89,40 @@ MANUFACTURER_SPECIFIC_DATA = 0xFF }; - /* Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 18.1 */ + /**********************************************************************/ + /*! + \brief + A list of values for the FLAGS AD Type + + \note + You can use more than one value in the FLAGS AD Type (ex. + LE_GENERAL_DISCOVERABLE and BREDR_NOT_SUPPORTED). + + \par Source + \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 18.1 + */ + /**********************************************************************/ enum Flags { - LE_LIMITED_DISCOVERABLE = 0x01, - LE_GENERAL_DISCOVERABLE = 0x02, - BREDR_NOT_SUPPORTED = 0x04, - SIMULTANEOUS_LE_BREDR_C = 0x08, - SIMULTANEOUS_LE_BREDR_H = 0x10 + LE_LIMITED_DISCOVERABLE = 0x01, /**< Peripheral device is discoverable for a limited period of time */ + LE_GENERAL_DISCOVERABLE = 0x02, /**< Peripheral device is discoverable at any moment */ + BREDR_NOT_SUPPORTED = 0x04, /**< Peripheral device is LE only */ + SIMULTANEOUS_LE_BREDR_C = 0x08, /**< Not relevant - central mode only */ + SIMULTANEOUS_LE_BREDR_H = 0x10 /**< Not relevant - central mode only */ }; - /* Bluetooth Core Specification Supplement, Part A, Section 1.12 */ - /* Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 12.2 */ - /* https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml */ + /**********************************************************************/ + /*! + \brief + A list of values for the APPEARANCE AD Type, which describes the + physical shape or appearance of the device + + \par Source + \li \c Bluetooth Core Specification Supplement, Part A, Section 1.12 + \li \c Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 12.2 + \li \c https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml + */ + /**********************************************************************/ enum Appearance { UNKNOWN = 0,
--- a/GapAdvertisingParams.cpp Wed Dec 18 19:39:19 2013 +0000 +++ b/GapAdvertisingParams.cpp Wed Dec 18 20:11:45 2013 +0000 @@ -11,7 +11,7 @@ \param[in] advType The GAP advertising mode to use for this device. Valid - values are defined in AdvertisingType + values are defined in AdvertisingType: \par ADV_NON_CONNECTABLE_UNDIRECTED All connections to the peripheral device will be refused. @@ -28,8 +28,7 @@ the secondary Scan Response payload will be included or available to central devices. - \note - + \par See Bluetooth Core Specification 4.0 (Vol. 3), Part C, Section 9.3 and Core Specification 4.0 (Vol. 6), Part B, Section 2.3.1 for further information on GAP connection @@ -46,13 +45,13 @@ your peripheral faster at the expense of more power being used by the radio due to the higher data transmit rate. - \note + \par This field must be set to 0 if connectionMode is equal to ADV_CONNECTABLE_DIRECTED - \note + \par See Bluetooth Core Specification, Vol 3., Part C, - Appendix A for suggested advertising intervals: + Appendix A for suggested advertising intervals. \param[in] timeout Advertising timeout between 0x1 and 0x3FFF (1 and 16383)
--- a/hw/bleradio.h Wed Dec 18 19:39:19 2013 +0000 +++ b/hw/bleradio.h Wed Dec 18 20:11:45 2013 +0000 @@ -6,18 +6,32 @@ #include "GapAdvertisingData.h" #include "GapAdvertisingParams.h" +/**************************************************************************/ +/*! + \brief + The base class used to abstract away BLE capable radio transceivers + or SOCs, to enable this BLE API to work with any radio transparently. +*/ +/**************************************************************************/ class BLERadio { protected: FunctionPointer _callback_event; public: + /******************************************************************/ + /*! + \brief + Identifies events generated by the radio HW when an event + callback occurs + */ + /******************************************************************/ typedef enum radio_event_e { - RADIO_EVENT_CONNECT = 0x01, - RADIO_EVENT_DISCONNECT = 0x02, - RADIO_EVENT_WRITE = 0x03, - RADIO_EVENT_RADIOERROR = 0x80 + RADIO_EVENT_CONNECT = 0x01, /**< A BLE connection was established by the radio */ + RADIO_EVENT_DISCONNECT = 0x02, /**< The BLE device was disconnected */ + RADIO_EVENT_WRITE = 0x03, /**< A BLE write request occured */ + RADIO_EVENT_RADIOERROR = 0x80 /**< A low level error occured on the radio */ } radioEvent_t; uint8_t serviceCount;