No changes
Fork of nRF51822 by
source/nRF5xn.h@458:b42881afcc6e, 2015-11-02 (annotated)
- Committer:
- rgrover1
- Date:
- Mon Nov 02 09:05:11 2015 +0000
- Revision:
- 458:b42881afcc6e
- Parent:
- 388:db85a09c27ef
- Child:
- 463:b869f947a37a
Synchronized with git rev 20b07e38
Author: Rohit Grover
update init() to match the chagnes around initializationCompleteCallback.
refer to https://github.com/ARMmbed/ble/pull/91 and https://github.com/ARMmbed/ble/issues/90
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rgrover1 | 388:db85a09c27ef | 1 | /* mbed Microcontroller Library |
rgrover1 | 388:db85a09c27ef | 2 | * Copyright (c) 2006-2013 ARM Limited |
rgrover1 | 388:db85a09c27ef | 3 | * |
rgrover1 | 388:db85a09c27ef | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
rgrover1 | 388:db85a09c27ef | 5 | * you may not use this file except in compliance with the License. |
rgrover1 | 388:db85a09c27ef | 6 | * You may obtain a copy of the License at |
rgrover1 | 388:db85a09c27ef | 7 | * |
rgrover1 | 388:db85a09c27ef | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
rgrover1 | 388:db85a09c27ef | 9 | * |
rgrover1 | 388:db85a09c27ef | 10 | * Unless required by applicable law or agreed to in writing, software |
rgrover1 | 388:db85a09c27ef | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
rgrover1 | 388:db85a09c27ef | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
rgrover1 | 388:db85a09c27ef | 13 | * See the License for the specific language governing permissions and |
rgrover1 | 388:db85a09c27ef | 14 | * limitations under the License. |
rgrover1 | 388:db85a09c27ef | 15 | */ |
rgrover1 | 388:db85a09c27ef | 16 | |
rgrover1 | 388:db85a09c27ef | 17 | #ifndef __NRF51822_H__ |
rgrover1 | 388:db85a09c27ef | 18 | #define __NRF51822_H__ |
rgrover1 | 388:db85a09c27ef | 19 | |
rgrover1 | 458:b42881afcc6e | 20 | #include "ble/BLE.h" |
rgrover1 | 388:db85a09c27ef | 21 | #include "ble/blecommon.h" |
rgrover1 | 458:b42881afcc6e | 22 | #include "ble/BLEInstanceBase.h" |
rgrover1 | 458:b42881afcc6e | 23 | |
rgrover1 | 388:db85a09c27ef | 24 | #include "nRF5xGap.h" |
rgrover1 | 388:db85a09c27ef | 25 | #include "nRF5xGattServer.h" |
rgrover1 | 388:db85a09c27ef | 26 | #include "nRF5xGattClient.h" |
rgrover1 | 388:db85a09c27ef | 27 | #include "nRF5xSecurityManager.h" |
rgrover1 | 458:b42881afcc6e | 28 | |
rgrover1 | 388:db85a09c27ef | 29 | #include "btle.h" |
rgrover1 | 388:db85a09c27ef | 30 | |
rgrover1 | 388:db85a09c27ef | 31 | class nRF5xn : public BLEInstanceBase |
rgrover1 | 388:db85a09c27ef | 32 | { |
rgrover1 | 388:db85a09c27ef | 33 | public: |
rgrover1 | 388:db85a09c27ef | 34 | nRF5xn(void); |
rgrover1 | 388:db85a09c27ef | 35 | virtual ~nRF5xn(void); |
rgrover1 | 388:db85a09c27ef | 36 | |
rgrover1 | 458:b42881afcc6e | 37 | virtual ble_error_t init(BLE::InstanceID_t instanceID, BLE::InitializationCompleteCallback_t); |
rgrover1 | 458:b42881afcc6e | 38 | virtual bool hasInitialized(void) const { |
rgrover1 | 458:b42881afcc6e | 39 | return initialized; |
rgrover1 | 458:b42881afcc6e | 40 | } |
rgrover1 | 388:db85a09c27ef | 41 | virtual ble_error_t shutdown(void); |
rgrover1 | 388:db85a09c27ef | 42 | virtual const char *getVersion(void); |
rgrover1 | 388:db85a09c27ef | 43 | |
rgrover1 | 388:db85a09c27ef | 44 | virtual Gap &getGap() { |
rgrover1 | 388:db85a09c27ef | 45 | return nRF5xGap::getInstance(); |
rgrover1 | 388:db85a09c27ef | 46 | }; |
rgrover1 | 388:db85a09c27ef | 47 | virtual const Gap &getGap() const { |
rgrover1 | 388:db85a09c27ef | 48 | return nRF5xGap::getInstance(); |
rgrover1 | 388:db85a09c27ef | 49 | }; |
rgrover1 | 388:db85a09c27ef | 50 | virtual GattServer &getGattServer() { |
rgrover1 | 388:db85a09c27ef | 51 | return nRF5xGattServer::getInstance(); |
rgrover1 | 388:db85a09c27ef | 52 | }; |
rgrover1 | 388:db85a09c27ef | 53 | virtual const GattServer &getGattServer() const { |
rgrover1 | 388:db85a09c27ef | 54 | return nRF5xGattServer::getInstance(); |
rgrover1 | 388:db85a09c27ef | 55 | }; |
rgrover1 | 388:db85a09c27ef | 56 | virtual GattClient &getGattClient() { |
rgrover1 | 388:db85a09c27ef | 57 | return nRF5xGattClient::getInstance(); |
rgrover1 | 388:db85a09c27ef | 58 | } |
rgrover1 | 388:db85a09c27ef | 59 | virtual const SecurityManager &getSecurityManager() const { |
rgrover1 | 388:db85a09c27ef | 60 | return nRF5xSecurityManager::getInstance(); |
rgrover1 | 388:db85a09c27ef | 61 | } |
rgrover1 | 388:db85a09c27ef | 62 | virtual SecurityManager &getSecurityManager() { |
rgrover1 | 388:db85a09c27ef | 63 | return nRF5xSecurityManager::getInstance(); |
rgrover1 | 388:db85a09c27ef | 64 | } |
rgrover1 | 388:db85a09c27ef | 65 | virtual void waitForEvent(void); |
rgrover1 | 458:b42881afcc6e | 66 | |
rgrover1 | 458:b42881afcc6e | 67 | private: |
rgrover1 | 458:b42881afcc6e | 68 | bool initialized; |
rgrover1 | 458:b42881afcc6e | 69 | BLE::InstanceID_t instanceID; |
rgrover1 | 388:db85a09c27ef | 70 | }; |
rgrover1 | 388:db85a09c27ef | 71 | |
rgrover1 | 388:db85a09c27ef | 72 | #endif |