Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
nRF51GattClient.h@328:f3aa0fddaa79, 2015-06-19 (annotated)
- Committer:
- rgrover1
- Date:
- Fri Jun 19 15:55:32 2015 +0100
- Revision:
- 328:f3aa0fddaa79
- Child:
- 329:d11ef9cc041b
Synchronized with git rev 0cc48daf
Author: Rohit Grover
introduce implementation for nRF51GattClient
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rgrover1 | 328:f3aa0fddaa79 | 1 | /* mbed Microcontroller Library |
| rgrover1 | 328:f3aa0fddaa79 | 2 | * Copyright (c) 2006-2013 ARM Limited |
| rgrover1 | 328:f3aa0fddaa79 | 3 | * |
| rgrover1 | 328:f3aa0fddaa79 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| rgrover1 | 328:f3aa0fddaa79 | 5 | * you may not use this file except in compliance with the License. |
| rgrover1 | 328:f3aa0fddaa79 | 6 | * You may obtain a copy of the License at |
| rgrover1 | 328:f3aa0fddaa79 | 7 | * |
| rgrover1 | 328:f3aa0fddaa79 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| rgrover1 | 328:f3aa0fddaa79 | 9 | * |
| rgrover1 | 328:f3aa0fddaa79 | 10 | * Unless required by applicable law or agreed to in writing, software |
| rgrover1 | 328:f3aa0fddaa79 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| rgrover1 | 328:f3aa0fddaa79 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| rgrover1 | 328:f3aa0fddaa79 | 13 | * See the License for the specific language governing permissions and |
| rgrover1 | 328:f3aa0fddaa79 | 14 | * limitations under the License. |
| rgrover1 | 328:f3aa0fddaa79 | 15 | */ |
| rgrover1 | 328:f3aa0fddaa79 | 16 | |
| rgrover1 | 328:f3aa0fddaa79 | 17 | #ifndef __NRF51822_GATT_CLIENT_H__ |
| rgrover1 | 328:f3aa0fddaa79 | 18 | #define __NRF51822_GATT_CLIENT_H__ |
| rgrover1 | 328:f3aa0fddaa79 | 19 | |
| rgrover1 | 328:f3aa0fddaa79 | 20 | #include "GattClient.h" |
| rgrover1 | 328:f3aa0fddaa79 | 21 | |
| rgrover1 | 328:f3aa0fddaa79 | 22 | class nRF51GattClient : public GattClient |
| rgrover1 | 328:f3aa0fddaa79 | 23 | { |
| rgrover1 | 328:f3aa0fddaa79 | 24 | public: |
| rgrover1 | 328:f3aa0fddaa79 | 25 | static nRF51GattClient &getInstance(); |
| rgrover1 | 328:f3aa0fddaa79 | 26 | |
| rgrover1 | 328:f3aa0fddaa79 | 27 | #if 0 |
| rgrover1 | 328:f3aa0fddaa79 | 28 | /* Functions that must be implemented from GattClient */ |
| rgrover1 | 328:f3aa0fddaa79 | 29 | virtual ble_error_t addService(GattService &); |
| rgrover1 | 328:f3aa0fddaa79 | 30 | virtual ble_error_t readValue(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP); |
| rgrover1 | 328:f3aa0fddaa79 | 31 | virtual ble_error_t readValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP); |
| rgrover1 | 328:f3aa0fddaa79 | 32 | virtual ble_error_t updateValue(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false); |
| rgrover1 | 328:f3aa0fddaa79 | 33 | virtual ble_error_t updateValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false); |
| rgrover1 | 328:f3aa0fddaa79 | 34 | virtual ble_error_t initializeGATTDatabase(void); |
| rgrover1 | 328:f3aa0fddaa79 | 35 | |
| rgrover1 | 328:f3aa0fddaa79 | 36 | /* nRF51 Functions */ |
| rgrover1 | 328:f3aa0fddaa79 | 37 | void eventCallback(void); |
| rgrover1 | 328:f3aa0fddaa79 | 38 | void hwCallback(ble_evt_t *p_ble_evt); |
| rgrover1 | 328:f3aa0fddaa79 | 39 | |
| rgrover1 | 328:f3aa0fddaa79 | 40 | private: |
| rgrover1 | 328:f3aa0fddaa79 | 41 | #endif |
| rgrover1 | 328:f3aa0fddaa79 | 42 | |
| rgrover1 | 328:f3aa0fddaa79 | 43 | public: |
| rgrover1 | 328:f3aa0fddaa79 | 44 | nRF51GattClient() { |
| rgrover1 | 328:f3aa0fddaa79 | 45 | /* empty */ |
| rgrover1 | 328:f3aa0fddaa79 | 46 | } |
| rgrover1 | 328:f3aa0fddaa79 | 47 | |
| rgrover1 | 328:f3aa0fddaa79 | 48 | private: |
| rgrover1 | 328:f3aa0fddaa79 | 49 | nRF51GattClient(const nRF51GattClient &); |
| rgrover1 | 328:f3aa0fddaa79 | 50 | const nRF51GattClient& operator=(const nRF51GattClient &); |
| rgrover1 | 328:f3aa0fddaa79 | 51 | }; |
| rgrover1 | 328:f3aa0fddaa79 | 52 | |
| rgrover1 | 328:f3aa0fddaa79 | 53 | #endif // ifndef __NRF51822_GATT_CLIENT_H__ |

