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: microbit_rubber_ducky microbit_mouse_BLE microbit_mouse_BLE_daybreak_version microbit_presenter
Fork of nRF51822 by
source/nRF51SecurityManager.h@387:b13ab9a7ddb9, 2015-07-21 (annotated)
- Committer:
- rgrover1
- Date:
- Tue Jul 21 13:23:44 2015 +0100
- Revision:
- 387:b13ab9a7ddb9
- Parent:
- nRF51SecurityManager.h@386:3253b512fb24
Synchronized with git rev e79eec6b
Author: Rohit Grover
Release 0.4.2
=============
This is a minor release.
Enhancements
~~~~~~~~~~~~
* fix #53: add GattClient API for handling HVX Events (notifications and
indications). Refer to GattClient::onHVX(HVXCallback_t ...).
* Reformat source tree to align nRF51822 for yotta.
Bugfixes
~~~~~~~~
none.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rgrover1 | 362:6fa0d4d555f6 | 1 | /* mbed Microcontroller Library |
| rgrover1 | 362:6fa0d4d555f6 | 2 | * Copyright (c) 2006-2013 ARM Limited |
| rgrover1 | 362:6fa0d4d555f6 | 3 | * |
| rgrover1 | 362:6fa0d4d555f6 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| rgrover1 | 362:6fa0d4d555f6 | 5 | * you may not use this file except in compliance with the License. |
| rgrover1 | 362:6fa0d4d555f6 | 6 | * You may obtain a copy of the License at |
| rgrover1 | 362:6fa0d4d555f6 | 7 | * |
| rgrover1 | 362:6fa0d4d555f6 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| rgrover1 | 362:6fa0d4d555f6 | 9 | * |
| rgrover1 | 362:6fa0d4d555f6 | 10 | * Unless required by applicable law or agreed to in writing, software |
| rgrover1 | 362:6fa0d4d555f6 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| rgrover1 | 362:6fa0d4d555f6 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| rgrover1 | 362:6fa0d4d555f6 | 13 | * See the License for the specific language governing permissions and |
| rgrover1 | 362:6fa0d4d555f6 | 14 | * limitations under the License. |
| rgrover1 | 362:6fa0d4d555f6 | 15 | */ |
| rgrover1 | 362:6fa0d4d555f6 | 16 | |
| rgrover1 | 362:6fa0d4d555f6 | 17 | #ifndef __NRF51822_SECURITY_MANAGER_H__ |
| rgrover1 | 362:6fa0d4d555f6 | 18 | #define __NRF51822_SECURITY_MANAGER_H__ |
| rgrover1 | 362:6fa0d4d555f6 | 19 | |
| rgrover1 | 362:6fa0d4d555f6 | 20 | #include <stddef.h> |
| rgrover1 | 362:6fa0d4d555f6 | 21 | |
| rgrover1 | 362:6fa0d4d555f6 | 22 | #include "ble/SecurityManager.h" |
| rgrover1 | 362:6fa0d4d555f6 | 23 | #include "btle_security.h" |
| rgrover1 | 362:6fa0d4d555f6 | 24 | |
| rgrover1 | 362:6fa0d4d555f6 | 25 | class nRF51SecurityManager : public SecurityManager |
| rgrover1 | 362:6fa0d4d555f6 | 26 | { |
| rgrover1 | 362:6fa0d4d555f6 | 27 | public: |
| rgrover1 | 362:6fa0d4d555f6 | 28 | static nRF51SecurityManager &getInstance(); |
| rgrover1 | 362:6fa0d4d555f6 | 29 | |
| rgrover1 | 362:6fa0d4d555f6 | 30 | /* Functions that must be implemented from SecurityManager */ |
| rgrover1 | 362:6fa0d4d555f6 | 31 | virtual ble_error_t init(bool enableBonding, |
| rgrover1 | 362:6fa0d4d555f6 | 32 | bool requireMITM, |
| rgrover1 | 362:6fa0d4d555f6 | 33 | SecurityIOCapabilities_t iocaps, |
| rgrover1 | 362:6fa0d4d555f6 | 34 | const Passkey_t passkey) { |
| rgrover1 | 362:6fa0d4d555f6 | 35 | return btle_initializeSecurity(enableBonding, requireMITM, iocaps, passkey); |
| rgrover1 | 362:6fa0d4d555f6 | 36 | } |
| rgrover1 | 362:6fa0d4d555f6 | 37 | |
| rgrover1 | 362:6fa0d4d555f6 | 38 | virtual ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) { |
| rgrover1 | 362:6fa0d4d555f6 | 39 | return btle_getLinkSecurity(connectionHandle, securityStatusP); |
| rgrover1 | 362:6fa0d4d555f6 | 40 | } |
| rgrover1 | 362:6fa0d4d555f6 | 41 | |
| rgrover1 | 362:6fa0d4d555f6 | 42 | virtual ble_error_t purgeAllBondingState(void) { |
| rgrover1 | 362:6fa0d4d555f6 | 43 | return btle_purgeAllBondingState(); |
| rgrover1 | 362:6fa0d4d555f6 | 44 | } |
| rgrover1 | 362:6fa0d4d555f6 | 45 | |
| rgrover1 | 362:6fa0d4d555f6 | 46 | public: |
| rgrover1 | 362:6fa0d4d555f6 | 47 | nRF51SecurityManager() { |
| rgrover1 | 362:6fa0d4d555f6 | 48 | /* empty */ |
| rgrover1 | 362:6fa0d4d555f6 | 49 | } |
| rgrover1 | 362:6fa0d4d555f6 | 50 | |
| rgrover1 | 362:6fa0d4d555f6 | 51 | private: |
| rgrover1 | 362:6fa0d4d555f6 | 52 | nRF51SecurityManager(const nRF51SecurityManager &); |
| rgrover1 | 362:6fa0d4d555f6 | 53 | const nRF51SecurityManager& operator=(const nRF51SecurityManager &); |
| rgrover1 | 362:6fa0d4d555f6 | 54 | }; |
| rgrover1 | 362:6fa0d4d555f6 | 55 | |
| rgrover1 | 362:6fa0d4d555f6 | 56 | #endif // ifndef __NRF51822_SECURITY_MANAGER_H__ |
