BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Revision:
92:3781dc6f8c18
Parent:
91:311bde45b251
--- 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;
-}