test firmware for BLE Micro V1.3 1. test io, vcc and ble 2. act as a UART to BLE bridge
Dependencies: BLE_API Buffer mbed
Fork of BLE_LEDBlinker by
nRF51822/source/nRF5xSecurityManager.h@12:c4090cb58976, 2015-12-08 (annotated)
- Committer:
- arch
- Date:
- Tue Dec 08 08:34:22 2015 +0000
- Revision:
- 12:c4090cb58976
- Parent:
- 11:c8cbc4bc2c17
fix USBTX/USBRX pins config
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arch | 11:c8cbc4bc2c17 | 1 | /* mbed Microcontroller Library |
arch | 11:c8cbc4bc2c17 | 2 | * Copyright (c) 2006-2013 ARM Limited |
arch | 11:c8cbc4bc2c17 | 3 | * |
arch | 11:c8cbc4bc2c17 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
arch | 11:c8cbc4bc2c17 | 5 | * you may not use this file except in compliance with the License. |
arch | 11:c8cbc4bc2c17 | 6 | * You may obtain a copy of the License at |
arch | 11:c8cbc4bc2c17 | 7 | * |
arch | 11:c8cbc4bc2c17 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
arch | 11:c8cbc4bc2c17 | 9 | * |
arch | 11:c8cbc4bc2c17 | 10 | * Unless required by applicable law or agreed to in writing, software |
arch | 11:c8cbc4bc2c17 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
arch | 11:c8cbc4bc2c17 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
arch | 11:c8cbc4bc2c17 | 13 | * See the License for the specific language governing permissions and |
arch | 11:c8cbc4bc2c17 | 14 | * limitations under the License. |
arch | 11:c8cbc4bc2c17 | 15 | */ |
arch | 11:c8cbc4bc2c17 | 16 | |
arch | 11:c8cbc4bc2c17 | 17 | #ifndef __NRF51822_SECURITY_MANAGER_H__ |
arch | 11:c8cbc4bc2c17 | 18 | #define __NRF51822_SECURITY_MANAGER_H__ |
arch | 11:c8cbc4bc2c17 | 19 | |
arch | 11:c8cbc4bc2c17 | 20 | #include <stddef.h> |
arch | 11:c8cbc4bc2c17 | 21 | |
arch | 11:c8cbc4bc2c17 | 22 | #include "ble/SecurityManager.h" |
arch | 11:c8cbc4bc2c17 | 23 | #include "btle_security.h" |
arch | 11:c8cbc4bc2c17 | 24 | |
arch | 11:c8cbc4bc2c17 | 25 | class nRF5xSecurityManager : public SecurityManager |
arch | 11:c8cbc4bc2c17 | 26 | { |
arch | 11:c8cbc4bc2c17 | 27 | public: |
arch | 11:c8cbc4bc2c17 | 28 | static nRF5xSecurityManager &getInstance(); |
arch | 11:c8cbc4bc2c17 | 29 | |
arch | 11:c8cbc4bc2c17 | 30 | /* Functions that must be implemented from SecurityManager */ |
arch | 11:c8cbc4bc2c17 | 31 | virtual ble_error_t init(bool enableBonding, |
arch | 11:c8cbc4bc2c17 | 32 | bool requireMITM, |
arch | 11:c8cbc4bc2c17 | 33 | SecurityIOCapabilities_t iocaps, |
arch | 11:c8cbc4bc2c17 | 34 | const Passkey_t passkey) { |
arch | 11:c8cbc4bc2c17 | 35 | return btle_initializeSecurity(enableBonding, requireMITM, iocaps, passkey); |
arch | 11:c8cbc4bc2c17 | 36 | } |
arch | 11:c8cbc4bc2c17 | 37 | |
arch | 11:c8cbc4bc2c17 | 38 | virtual ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) { |
arch | 11:c8cbc4bc2c17 | 39 | return btle_getLinkSecurity(connectionHandle, securityStatusP); |
arch | 11:c8cbc4bc2c17 | 40 | } |
arch | 11:c8cbc4bc2c17 | 41 | |
arch | 11:c8cbc4bc2c17 | 42 | virtual ble_error_t purgeAllBondingState(void) { |
arch | 11:c8cbc4bc2c17 | 43 | return btle_purgeAllBondingState(); |
arch | 11:c8cbc4bc2c17 | 44 | } |
arch | 11:c8cbc4bc2c17 | 45 | |
arch | 11:c8cbc4bc2c17 | 46 | public: |
arch | 11:c8cbc4bc2c17 | 47 | nRF5xSecurityManager() { |
arch | 11:c8cbc4bc2c17 | 48 | /* empty */ |
arch | 11:c8cbc4bc2c17 | 49 | } |
arch | 11:c8cbc4bc2c17 | 50 | |
arch | 11:c8cbc4bc2c17 | 51 | private: |
arch | 11:c8cbc4bc2c17 | 52 | nRF5xSecurityManager(const nRF5xSecurityManager &); |
arch | 11:c8cbc4bc2c17 | 53 | const nRF5xSecurityManager& operator=(const nRF5xSecurityManager &); |
arch | 11:c8cbc4bc2c17 | 54 | }; |
arch | 11:c8cbc4bc2c17 | 55 | |
arch | 11:c8cbc4bc2c17 | 56 | #endif // ifndef __NRF51822_SECURITY_MANAGER_H__ |