YUFEI JIANG / BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Committer:
bogdanm
Date:
Tue Apr 01 11:04:56 2014 +0100
Revision:
31:2c94f0501807
Parent:
29:011e95ce78b8
Child:
34:da2ea8cd6216
Synchronized with git revision fdcc1e387426ce216bc17175b73bcd5f4aececff

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 */
ktownsend 27:4a83843f04b0 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 {
ktownsend 29:011e95ce78b8 34 private:
ktownsend 29:011e95ce78b8 35
ktownsend 29:011e95ce78b8 36 public:
ktownsend 29:011e95ce78b8 37 GattService(uint8_t[16]); /* 128-bit Base UUID */
ktownsend 29:011e95ce78b8 38 GattService(uint16_t); /* 16-bit BLE UUID */
ktownsend 29:011e95ce78b8 39 virtual ~GattService(void);
ktownsend 29:011e95ce78b8 40
ktownsend 29:011e95ce78b8 41 UUID primaryServiceID;
ktownsend 29:011e95ce78b8 42 uint8_t characteristicCount;
bogdanm 31:2c94f0501807 43 GattCharacteristic* characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
bogdanm 31:2c94f0501807 44 uint16_t handle;
bogdanm 31:2c94f0501807 45
ktownsend 29:011e95ce78b8 46 ble_error_t addCharacteristic(GattCharacteristic &);
bogdanm 31:2c94f0501807 47
bogdanm 31:2c94f0501807 48 enum {
bogdanm 31:2c94f0501807 49 UUID_ALERT_NOTIFICATION_SERVICE = 0x1811,
bogdanm 31:2c94f0501807 50 UUID_BATTERY_SERVICE = 0x180F,
bogdanm 31:2c94f0501807 51 UUID_BLOOD_PRESSURE_SERVICE = 0x1810,
bogdanm 31:2c94f0501807 52 UUID_CURRENT_TIME_SERVICE = 0x1805,
bogdanm 31:2c94f0501807 53 UUID_CYCLING_SPEED_AND_CADENCE = 0x1816,
bogdanm 31:2c94f0501807 54 UUID_DEVICE_INFORMATION_SERVICE = 0x180A,
bogdanm 31:2c94f0501807 55 UUID_GLUCOSE_SERVICE = 0x1808,
bogdanm 31:2c94f0501807 56 UUID_HEALTH_THERMOMETER_SERVICE = 0x1809,
bogdanm 31:2c94f0501807 57 UUID_HEART_RATE_SERVICE = 0x180D,
bogdanm 31:2c94f0501807 58 UUID_HUMAN_INTERFACE_DEVICE_SERVICE = 0x1812,
bogdanm 31:2c94f0501807 59 UUID_IMMEDIATE_ALERT_SERVICE = 0x1802,
bogdanm 31:2c94f0501807 60 UUID_LINK_LOSS_SERVICE = 0x1803,
bogdanm 31:2c94f0501807 61 UUID_NEXT_DST_CHANGE_SERVICE = 0x1807,
bogdanm 31:2c94f0501807 62 UUID_PHONE_ALERT_STATUS_SERVICE = 0x180E,
bogdanm 31:2c94f0501807 63 UUID_REFERENCE_TIME_UPDATE_SERVICE = 0x1806,
bogdanm 31:2c94f0501807 64 UUID_RUNNING_SPEED_AND_CADENCE = 0x1814,
bogdanm 31:2c94f0501807 65 UUID_SCAN_PARAMETERS_SERVICE = 0x1813,
bogdanm 31:2c94f0501807 66 UUID_TX_POWER_SERVICE = 0x1804
bogdanm 31:2c94f0501807 67 };
ktownsend 2:ffc5216bd2cc 68 };
ktownsend 2:ffc5216bd2cc 69
ktownsend 2:ffc5216bd2cc 70 #endif