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