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/btle/btle_security.h@11:c8cbc4bc2c17, 2015-12-08 (annotated)
- Committer:
- arch
- Date:
- Tue Dec 08 06:02:25 2015 +0000
- Revision:
- 11:c8cbc4bc2c17
test firmware for BLE Micro V1.3
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 _BTLE_SECURITY_H_ |
arch | 11:c8cbc4bc2c17 | 18 | #define _BTLE_SECURITY_H_ |
arch | 11:c8cbc4bc2c17 | 19 | |
arch | 11:c8cbc4bc2c17 | 20 | #include "ble/Gap.h" |
arch | 11:c8cbc4bc2c17 | 21 | #include "ble/SecurityManager.h" |
arch | 11:c8cbc4bc2c17 | 22 | |
arch | 11:c8cbc4bc2c17 | 23 | /** |
arch | 11:c8cbc4bc2c17 | 24 | * Enable Nordic's Device Manager, which brings in functionality from the |
arch | 11:c8cbc4bc2c17 | 25 | * stack's Security Manager. The Security Manager implements the actual |
arch | 11:c8cbc4bc2c17 | 26 | * cryptographic algorithms and protocol exchanges that allow two devices to |
arch | 11:c8cbc4bc2c17 | 27 | * securely exchange data and privately detect each other. |
arch | 11:c8cbc4bc2c17 | 28 | * |
arch | 11:c8cbc4bc2c17 | 29 | * @param[in] enableBonding Allow for bonding. |
arch | 11:c8cbc4bc2c17 | 30 | * @param[in] requireMITM Require protection for man-in-the-middle attacks. |
arch | 11:c8cbc4bc2c17 | 31 | * @param[in] iocaps To specify IO capabilities of this peripheral, |
arch | 11:c8cbc4bc2c17 | 32 | * such as availability of a display or keyboard to |
arch | 11:c8cbc4bc2c17 | 33 | * support out-of-band exchanges of security data. |
arch | 11:c8cbc4bc2c17 | 34 | * @param[in] passkey To specify a static passkey. |
arch | 11:c8cbc4bc2c17 | 35 | * |
arch | 11:c8cbc4bc2c17 | 36 | * @return BLE_ERROR_NONE on success. |
arch | 11:c8cbc4bc2c17 | 37 | */ |
arch | 11:c8cbc4bc2c17 | 38 | ble_error_t btle_initializeSecurity(bool enableBonding = true, |
arch | 11:c8cbc4bc2c17 | 39 | bool requireMITM = true, |
arch | 11:c8cbc4bc2c17 | 40 | SecurityManager::SecurityIOCapabilities_t iocaps = SecurityManager::IO_CAPS_NONE, |
arch | 11:c8cbc4bc2c17 | 41 | const SecurityManager::Passkey_t passkey = NULL); |
arch | 11:c8cbc4bc2c17 | 42 | |
arch | 11:c8cbc4bc2c17 | 43 | /** |
arch | 11:c8cbc4bc2c17 | 44 | * Get the security status of a link. |
arch | 11:c8cbc4bc2c17 | 45 | * |
arch | 11:c8cbc4bc2c17 | 46 | * @param[in] connectionHandle |
arch | 11:c8cbc4bc2c17 | 47 | * Handle to identify the connection. |
arch | 11:c8cbc4bc2c17 | 48 | * @param[out] securityStatusP |
arch | 11:c8cbc4bc2c17 | 49 | * security status. |
arch | 11:c8cbc4bc2c17 | 50 | * |
arch | 11:c8cbc4bc2c17 | 51 | * @return BLE_SUCCESS Or appropriate error code indicating reason for failure. |
arch | 11:c8cbc4bc2c17 | 52 | */ |
arch | 11:c8cbc4bc2c17 | 53 | ble_error_t btle_getLinkSecurity(Gap::Handle_t connectionHandle, SecurityManager::LinkSecurityStatus_t *securityStatusP); |
arch | 11:c8cbc4bc2c17 | 54 | |
arch | 11:c8cbc4bc2c17 | 55 | /** |
arch | 11:c8cbc4bc2c17 | 56 | * Function for deleting all peer device context and all related bonding |
arch | 11:c8cbc4bc2c17 | 57 | * information from the database. |
arch | 11:c8cbc4bc2c17 | 58 | * |
arch | 11:c8cbc4bc2c17 | 59 | * @retval BLE_ERROR_NONE On success, else an error code indicating reason for failure. |
arch | 11:c8cbc4bc2c17 | 60 | * @retval BLE_ERROR_INVALID_STATE If the API is called without module initialization and/or |
arch | 11:c8cbc4bc2c17 | 61 | * application registration. |
arch | 11:c8cbc4bc2c17 | 62 | */ |
arch | 11:c8cbc4bc2c17 | 63 | ble_error_t btle_purgeAllBondingState(void); |
arch | 11:c8cbc4bc2c17 | 64 | |
arch | 11:c8cbc4bc2c17 | 65 | #endif /* _BTLE_SECURITY_H_ */ |