library for BLE_GAP_backpack

Dependencies:   nrf51-sdk

Fork of nRF51822 by Nordic Semiconductor

Committer:
vcoubard
Date:
Mon Jan 11 10:19:18 2016 +0000
Revision:
566:e425ad9e5d6e
Parent:
565:cf03471a4ec4
Child:
570:f162898cb6c4
Synchronized with git rev 52200b37
Author: Rohit Grover
follow the extraction of ddress related types from Gap.h into BLEProtocol.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 565:cf03471a4ec4 1 /* mbed Microcontroller Library
vcoubard 565:cf03471a4ec4 2 * Copyright (c) 2006-2013 ARM Limited
vcoubard 565:cf03471a4ec4 3 *
vcoubard 565:cf03471a4ec4 4 * Licensed under the Apache License, Version 2.0 (the "License");
vcoubard 565:cf03471a4ec4 5 * you may not use this file except in compliance with the License.
vcoubard 565:cf03471a4ec4 6 * You may obtain a copy of the License at
vcoubard 565:cf03471a4ec4 7 *
vcoubard 565:cf03471a4ec4 8 * http://www.apache.org/licenses/LICENSE-2.0
vcoubard 565:cf03471a4ec4 9 *
vcoubard 565:cf03471a4ec4 10 * Unless required by applicable law or agreed to in writing, software
vcoubard 565:cf03471a4ec4 11 * distributed under the License is distributed on an "AS IS" BASIS,
vcoubard 565:cf03471a4ec4 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
vcoubard 565:cf03471a4ec4 13 * See the License for the specific language governing permissions and
vcoubard 565:cf03471a4ec4 14 * limitations under the License.
vcoubard 565:cf03471a4ec4 15 */
vcoubard 565:cf03471a4ec4 16
vcoubard 565:cf03471a4ec4 17 #ifndef __NRF51822_H__
vcoubard 565:cf03471a4ec4 18 #define __NRF51822_H__
vcoubard 565:cf03471a4ec4 19
vcoubard 565:cf03471a4ec4 20 #include "ble/BLE.h"
vcoubard 565:cf03471a4ec4 21 #include "ble/blecommon.h"
vcoubard 565:cf03471a4ec4 22 #include "ble/BLEInstanceBase.h"
vcoubard 565:cf03471a4ec4 23
vcoubard 565:cf03471a4ec4 24 #include "nRF5xGap.h"
vcoubard 565:cf03471a4ec4 25 #include "nRF5xGattServer.h"
vcoubard 565:cf03471a4ec4 26 #include "nRF5xGattClient.h"
vcoubard 565:cf03471a4ec4 27 #include "nRF5xSecurityManager.h"
vcoubard 565:cf03471a4ec4 28
vcoubard 565:cf03471a4ec4 29 #include "btle.h"
vcoubard 565:cf03471a4ec4 30
vcoubard 565:cf03471a4ec4 31 class nRF5xn : public BLEInstanceBase
vcoubard 565:cf03471a4ec4 32 {
vcoubard 565:cf03471a4ec4 33 public:
vcoubard 565:cf03471a4ec4 34 nRF5xn(void);
vcoubard 565:cf03471a4ec4 35 virtual ~nRF5xn(void);
vcoubard 565:cf03471a4ec4 36
vcoubard 565:cf03471a4ec4 37 virtual ble_error_t init(BLE::InstanceID_t instanceID, FunctionPointerWithContext<BLE::InitializationCompleteCallbackContext *> callback);
vcoubard 565:cf03471a4ec4 38 virtual bool hasInitialized(void) const {
vcoubard 565:cf03471a4ec4 39 return initialized;
vcoubard 565:cf03471a4ec4 40 }
vcoubard 565:cf03471a4ec4 41 virtual ble_error_t shutdown(void);
vcoubard 565:cf03471a4ec4 42 virtual const char *getVersion(void);
vcoubard 565:cf03471a4ec4 43
vcoubard 565:cf03471a4ec4 44 virtual Gap &getGap() {
vcoubard 566:e425ad9e5d6e 45 return nRF5xGap::getInstance();
vcoubard 565:cf03471a4ec4 46 };
vcoubard 566:e425ad9e5d6e 47 virtual const Gap &getGap() const {
vcoubard 566:e425ad9e5d6e 48 return nRF5xGap::getInstance();
vcoubard 566:e425ad9e5d6e 49 };
vcoubard 565:cf03471a4ec4 50 virtual GattServer &getGattServer() {
vcoubard 566:e425ad9e5d6e 51 return nRF5xGattServer::getInstance();
vcoubard 565:cf03471a4ec4 52 };
vcoubard 566:e425ad9e5d6e 53 virtual const GattServer &getGattServer() const {
vcoubard 566:e425ad9e5d6e 54 return nRF5xGattServer::getInstance();
vcoubard 566:e425ad9e5d6e 55 };
vcoubard 565:cf03471a4ec4 56 virtual GattClient &getGattClient() {
vcoubard 566:e425ad9e5d6e 57 return nRF5xGattClient::getInstance();
vcoubard 565:cf03471a4ec4 58 }
vcoubard 565:cf03471a4ec4 59 virtual const SecurityManager &getSecurityManager() const {
vcoubard 566:e425ad9e5d6e 60 return nRF5xSecurityManager::getInstance();
vcoubard 565:cf03471a4ec4 61 }
vcoubard 566:e425ad9e5d6e 62 virtual SecurityManager &getSecurityManager() {
vcoubard 566:e425ad9e5d6e 63 return nRF5xSecurityManager::getInstance();
vcoubard 566:e425ad9e5d6e 64 }
vcoubard 565:cf03471a4ec4 65 virtual void waitForEvent(void);
vcoubard 565:cf03471a4ec4 66
vcoubard 565:cf03471a4ec4 67 private:
vcoubard 565:cf03471a4ec4 68 bool initialized;
vcoubard 565:cf03471a4ec4 69 BLE::InstanceID_t instanceID;
vcoubard 565:cf03471a4ec4 70 };
vcoubard 565:cf03471a4ec4 71
rgrover1 388:db85a09c27ef 72 #endif