Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: GattService.cpp
- Revision:
- 92:3781dc6f8c18
- Parent:
- 91:311bde45b251
diff -r 311bde45b251 -r 3781dc6f8c18 GattService.cpp
--- a/GattService.cpp Wed Jun 11 14:14:04 2014 +0100
+++ b/GattService.cpp Wed Jun 11 14:42:08 2014 +0100
@@ -36,52 +36,8 @@
@endcode
*/
/**************************************************************************/
-GattService::GattService(const UUID &uuid) : primaryServiceID(uuid), characteristicCount(0), characteristics(), handle(0)
+GattService::GattService(const UUID &uuid, GattCharacteristic *characteristics[], unsigned numCharacteristics) :
+ _primaryServiceID(uuid), _characteristicCount(numCharacteristics), _characteristics(characteristics), _handle(0)
{
/* empty */
}
-
-/**************************************************************************/
-/*!
- @brief Destructor
-*/
-/**************************************************************************/
-GattService::~GattService(void)
-{
-}
-
-/**************************************************************************/
-/*!
- @brief Adds a GattCharacterisic to the service.
-
- @note This function will not update the .handle field in the
- GattCharacteristic. This value is updated when the parent
- service is added via the radio driver.
-
- @param[in] characteristic
- The GattCharacteristic object describing the characteristic
- to add to this service
-
- @returns BLE_ERROR_NONE (0) if everything executed correctly, or an
- error code if there was a problem
- @retval BLE_ERROR_NONE
- Everything executed correctly
-
- @section EXAMPLE
-
- @code
-
- @endcode
-*/
-/**************************************************************************/
-ble_error_t GattService::addCharacteristic(GattCharacteristic & characteristic)
-{
- /* ToDo: Make sure we don't overflow the array, etc. */
- /* ToDo: Make sure this characteristic UUID doesn't already exist */
- /* ToDo: Basic validation */
-
- characteristics[characteristicCount] = &characteristic;
- characteristicCount++;
-
- return BLE_ERROR_NONE;
-}
