Minor temporary patch to allow DFU packet callback
Fork of BLE_API by
GattService.h@29:011e95ce78b8, 2014-01-16 (annotated)
- Committer:
- ktownsend
- Date:
- Thu Jan 16 22:29:53 2014 +0000
- Revision:
- 29:011e95ce78b8
- Parent:
- 27:4a83843f04b0
- Child:
- 31:2c94f0501807
Added better radio abstraction layer, moved Gatt enums from blecommon.h to GattCharacteristic.h
Who changed what in which revision?
User | Revision | Line number | New 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; |
ktownsend | 29:011e95ce78b8 | 43 | GattCharacteristic characteristics[BLE_SERVICE_MAX_CHARACTERISTICS]; |
ktownsend | 29:011e95ce78b8 | 44 | uint8_t handle; |
ktownsend | 29:011e95ce78b8 | 45 | |
ktownsend | 29:011e95ce78b8 | 46 | ble_error_t addCharacteristic(GattCharacteristic &); |
ktownsend | 2:ffc5216bd2cc | 47 | }; |
ktownsend | 2:ffc5216bd2cc | 48 | |
ktownsend | 2:ffc5216bd2cc | 49 | #endif |