Compatible with Keewi v1

Fork of BLE_API by Bluetooth Low Energy

Committer:
Rohit Grover
Date:
Thu Jun 05 08:52:20 2014 +0100
Revision:
68:dcadab8a56dd
Parent:
67:0fac4e99f29b
Child:
69:2fd349295d2c
white space diffs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 27:4a83843f04b0 1 /* mbed Microcontroller Library
ktownsend 27:4a83843f04b0 2 * Copyright (c) 2006-2013 ARM Limited
ktownsend 27:4a83843f04b0 3 *
ktownsend 27:4a83843f04b0 4 * Licensed under the Apache License, Version 2.0 (the "License");
ktownsend 27:4a83843f04b0 5 * you may not use this file except in compliance with the License.
ktownsend 27:4a83843f04b0 6 * You may obtain a copy of the License at
ktownsend 27:4a83843f04b0 7 *
ktownsend 27:4a83843f04b0 8 * http://www.apache.org/licenses/LICENSE-2.0
ktownsend 27:4a83843f04b0 9 *
ktownsend 27:4a83843f04b0 10 * Unless required by applicable law or agreed to in writing, software
ktownsend 27:4a83843f04b0 11 * distributed under the License is distributed on an "AS IS" BASIS,
ktownsend 27:4a83843f04b0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ktownsend 27:4a83843f04b0 13 * See the License for the specific language governing permissions and
ktownsend 27:4a83843f04b0 14 * limitations under the License.
ktownsend 27:4a83843f04b0 15 */
Rohit Grover 34:da2ea8cd6216 16
ktownsend 27:4a83843f04b0 17
ktownsend 2:ffc5216bd2cc 18 #ifndef __GATT_SERVICE_H__
ktownsend 2:ffc5216bd2cc 19 #define __GATT_SERVICE_H__
ktownsend 2:ffc5216bd2cc 20
ktownsend 2:ffc5216bd2cc 21 #include "blecommon.h"
ktownsend 27:4a83843f04b0 22 #include "UUID.h"
ktownsend 2:ffc5216bd2cc 23 #include "GattCharacteristic.h"
ktownsend 2:ffc5216bd2cc 24
ktownsend 2:ffc5216bd2cc 25 #define BLE_SERVICE_MAX_CHARACTERISTICS (5)
ktownsend 2:ffc5216bd2cc 26
ktownsend 29:011e95ce78b8 27 /**************************************************************************/
ktownsend 29:011e95ce78b8 28 /*!
ktownsend 29:011e95ce78b8 29 \brief GATT service
ktownsend 29:011e95ce78b8 30 */
ktownsend 29:011e95ce78b8 31 /**************************************************************************/
ktownsend 2:ffc5216bd2cc 32 class GattService
ktownsend 2:ffc5216bd2cc 33 {
Rohit Grover 34:da2ea8cd6216 34 private:
Rohit Grover 34:da2ea8cd6216 35
Rohit Grover 34:da2ea8cd6216 36 public:
Rohit Grover 67:0fac4e99f29b 37 GattService(const LongUUID_t);
Rohit Grover 67:0fac4e99f29b 38 GattService(ShortUUID_t); /* 16-bit BLE UUID */
Rohit Grover 34:da2ea8cd6216 39 virtual ~GattService(void);
bogdanm 31:2c94f0501807 40
Rohit Grover 34:da2ea8cd6216 41 UUID primaryServiceID;
Rohit Grover 34:da2ea8cd6216 42 uint8_t characteristicCount;
Rohit Grover 34:da2ea8cd6216 43 GattCharacteristic *characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
Rohit Grover 34:da2ea8cd6216 44 uint16_t handle;
Rohit Grover 34:da2ea8cd6216 45
Rohit Grover 34:da2ea8cd6216 46 ble_error_t addCharacteristic(GattCharacteristic &);
bogdanm 31:2c94f0501807 47
Rohit Grover 34:da2ea8cd6216 48 enum {
Rohit Grover 34:da2ea8cd6216 49 UUID_ALERT_NOTIFICATION_SERVICE = 0x1811,
Rohit Grover 34:da2ea8cd6216 50 UUID_BATTERY_SERVICE = 0x180F,
Rohit Grover 34:da2ea8cd6216 51 UUID_BLOOD_PRESSURE_SERVICE = 0x1810,
Rohit Grover 34:da2ea8cd6216 52 UUID_CURRENT_TIME_SERVICE = 0x1805,
Rohit Grover 34:da2ea8cd6216 53 UUID_CYCLING_SPEED_AND_CADENCE = 0x1816,
Rohit Grover 34:da2ea8cd6216 54 UUID_DEVICE_INFORMATION_SERVICE = 0x180A,
Rohit Grover 34:da2ea8cd6216 55 UUID_GLUCOSE_SERVICE = 0x1808,
Rohit Grover 34:da2ea8cd6216 56 UUID_HEALTH_THERMOMETER_SERVICE = 0x1809,
Rohit Grover 34:da2ea8cd6216 57 UUID_HEART_RATE_SERVICE = 0x180D,
Rohit Grover 34:da2ea8cd6216 58 UUID_HUMAN_INTERFACE_DEVICE_SERVICE = 0x1812,
Rohit Grover 34:da2ea8cd6216 59 UUID_IMMEDIATE_ALERT_SERVICE = 0x1802,
Rohit Grover 34:da2ea8cd6216 60 UUID_LINK_LOSS_SERVICE = 0x1803,
Rohit Grover 34:da2ea8cd6216 61 UUID_NEXT_DST_CHANGE_SERVICE = 0x1807,
Rohit Grover 34:da2ea8cd6216 62 UUID_PHONE_ALERT_STATUS_SERVICE = 0x180E,
Rohit Grover 34:da2ea8cd6216 63 UUID_REFERENCE_TIME_UPDATE_SERVICE = 0x1806,
Rohit Grover 34:da2ea8cd6216 64 UUID_RUNNING_SPEED_AND_CADENCE = 0x1814,
Rohit Grover 34:da2ea8cd6216 65 UUID_SCAN_PARAMETERS_SERVICE = 0x1813,
Rohit Grover 34:da2ea8cd6216 66 UUID_TX_POWER_SERVICE = 0x1804
Rohit Grover 34:da2ea8cd6216 67 };
ktownsend 2:ffc5216bd2cc 68 };
ktownsend 2:ffc5216bd2cc 69
Rohit Grover 34:da2ea8cd6216 70 #endif // ifndef __GATT_SERVICE_H__