BLE: Improve DiscoveredCharacteristicDescriptor.h documentation.

pull/5392/head
Vincent Coubard 2017-10-23 18:49:21 -05:00 committed by Vincent Coubard
parent 9577735f7a
commit b163f321ad
1 changed files with 81 additions and 39 deletions

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__ #ifndef MBED_DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
#define __DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__ #define MBED_DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__
#include "UUID.h" #include "UUID.h"
#include "Gap.h" #include "Gap.h"
@ -24,16 +24,32 @@
#include "CharacteristicDescriptorDiscovery.h" #include "CharacteristicDescriptorDiscovery.h"
/** /**
* @brief Representation of a descriptor discovered during a GattClient * @addtogroup ble
* discovery procedure (see GattClient::discoverCharacteristicDescriptors or * @{
* DiscoveredCharacteristic::discoverDescriptors ). * @addtogroup gatt
* @{
* @addtogroup client
* @{
*/
/**
* Representation of a characteristic descriptor discovered.
* *
* @details Provide detailed informations about a discovered characteristic descriptor * Characteristic descriptors can be seen as the meta data of the characteristic.
* like: * They can contain things such as the unit of the characteristic value, extra
* - Its UUID (see #getUUID). * permission informations or the Client Configuration state regards to
* - Its handle (see #getAttributeHandle) * notification or indication.
* Basic read (see GattClient::read) and write (see GattClient::write) procedure from *
* GattClient can be used access the value of the descriptor. * The descriptors of a characterstic are discovered by a Characteristic
* Descriptor Discovery Procedure which can be initiated by either
* GattClient::discoverCharacteristicDescriptors() or
* DiscoveredCharacteristic::discoverDescriptors().
*
* The discovery procedure returns the UUID of the descriptor (its type) and its
* handle.
*
* Read and write of the descriptor value can initiated respectively by
* GattClient::read and GattClient::write.
* *
* @todo read member function * @todo read member function
* @todo write member function * @todo write member function
@ -44,60 +60,80 @@ class DiscoveredCharacteristicDescriptor {
public: public:
/** /**
* @brief construct a new instance of a DiscoveredCharacteristicDescriptor * Construct a new instance of a DiscoveredCharacteristicDescriptor.
* *
* @param client The client from where the descriptor has been discovered * @param[in] client The client which has discovered the descriptor.
* @param connectionHandle The connection handle on which the descriptor has * @param[in] connectionHandle Handle of the connection to the GATT server
* been discovered * containing the descriptor.
* @param attributeHandle The handle of the attribute containing this descriptor * @param[in] attributeHandle GATT attribute handle of the descriptor.
* @param uuid The UUID of the descriptor * @param[in] uuid UUID of the descriptor.
*
* @note This constructor is not meant to be called directly by application
* code. Descriptors discovered are generated by the GattClient class.
*/ */
DiscoveredCharacteristicDescriptor( DiscoveredCharacteristicDescriptor(
GattClient* client, Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const UUID& uuid) : GattClient *client,
_client(client), _connectionHandle(connectionHandle), _uuid(uuid), _gattHandle(attributeHandle) { Gap::Handle_t connectionHandle,
GattAttribute::Handle_t attributeHandle,
const UUID &uuid
) : _client(client),
_connectionHandle(connectionHandle),
_uuid(uuid),
_gattHandle(attributeHandle) {
} }
/** /**
* @brief Return the GattClient which can operate on this descriptor. * Return the GattClient which can operate on this descriptor.
* @return The GattClient which can operate on this descriptor. *
* @return GattClient which can operate on this descriptor.
*/ */
GattClient* getGattClient() { GattClient* getGattClient()
{
return _client; return _client;
} }
/** /**
* @brief Return the GattClient which can operate on this descriptor. * Return the GattClient which can operate on this descriptor.
* @return The GattClient which can operate on this descriptor. *
* @return GattClient which can operate on this descriptor.
*/ */
const GattClient* getGattClient() const { const GattClient* getGattClient() const
{
return _client; return _client;
} }
/** /**
* @brief Return the connection handle to the GattServer which contain * Return the connection handle to the GattServer containing this
* this descriptor. * descriptor.
* @return the connection handle to the GattServer which contain *
* this descriptor. * @return the connection handle to the GattServer containing this
* descriptor.
*/ */
Gap::Handle_t getConnectionHandle() const { Gap::Handle_t getConnectionHandle() const
{
return _connectionHandle; return _connectionHandle;
} }
/** /**
* @brief Return the UUID of this descriptor * Return the UUID of this descriptor.
* @return the UUID of this descriptor *
* @return UUID of this descriptor.
*/ */
const UUID& getUUID(void) const { const UUID& getUUID(void) const
{
return _uuid; return _uuid;
} }
/** /**
* @brief Return the attribute handle to use to access to this descriptor * Return the attribute handle of this descriptor.
* on the gatt server. *
* @return The attribute handle of the descriptor * This attribute handle can be used to interact with the descriptor on its
* gatt server.
*
* @return Attribute handle of the descriptor
*/ */
GattAttribute::Handle_t getAttributeHandle() const { GattAttribute::Handle_t getAttributeHandle() const
{
return _gattHandle; return _gattHandle;
} }
@ -108,4 +144,10 @@ private:
GattAttribute::Handle_t _gattHandle; GattAttribute::Handle_t _gattHandle;
}; };
#endif /*__DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__*/ /**
* @}
* @}
* @}
*/
#endif /* MBED_DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__ */