https://developer.mbed.org/users/TheoHavercroft/code/nrf51-sdk/
Fork of nRF51822 by
source/btle/btle_security.h@615:65ea2acfc6a2, 2016-04-06 (annotated)
- Committer:
- LancasterUniversity
- Date:
- Wed Apr 06 22:38:43 2016 +0100
- Revision:
- 615:65ea2acfc6a2
- Parent:
- 613:cbc548e9df98
- Child:
- 616:a8f9b022d8fd
Synchronized with git rev 60a7c0c0
Author: Rohit Grover
bring in the latest changes for BLE::init() where we allow <object, member> tuples for init callback.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LancasterUniversity | 615:65ea2acfc6a2 | 1 | /* mbed Microcontroller Library |
LancasterUniversity | 615:65ea2acfc6a2 | 2 | * Copyright (c) 2006-2013 ARM Limited |
LancasterUniversity | 615:65ea2acfc6a2 | 3 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
LancasterUniversity | 615:65ea2acfc6a2 | 5 | * you may not use this file except in compliance with the License. |
LancasterUniversity | 615:65ea2acfc6a2 | 6 | * You may obtain a copy of the License at |
LancasterUniversity | 615:65ea2acfc6a2 | 7 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
LancasterUniversity | 615:65ea2acfc6a2 | 9 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 10 | * Unless required by applicable law or agreed to in writing, software |
LancasterUniversity | 615:65ea2acfc6a2 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
LancasterUniversity | 615:65ea2acfc6a2 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
LancasterUniversity | 615:65ea2acfc6a2 | 13 | * See the License for the specific language governing permissions and |
LancasterUniversity | 615:65ea2acfc6a2 | 14 | * limitations under the License. |
LancasterUniversity | 615:65ea2acfc6a2 | 15 | */ |
LancasterUniversity | 615:65ea2acfc6a2 | 16 | |
LancasterUniversity | 615:65ea2acfc6a2 | 17 | #ifndef _BTLE_SECURITY_H_ |
LancasterUniversity | 615:65ea2acfc6a2 | 18 | #define _BTLE_SECURITY_H_ |
LancasterUniversity | 615:65ea2acfc6a2 | 19 | |
LancasterUniversity | 615:65ea2acfc6a2 | 20 | #include "ble/Gap.h" |
LancasterUniversity | 615:65ea2acfc6a2 | 21 | #include "ble/SecurityManager.h" |
LancasterUniversity | 615:65ea2acfc6a2 | 22 | |
LancasterUniversity | 615:65ea2acfc6a2 | 23 | /** |
LancasterUniversity | 615:65ea2acfc6a2 | 24 | * Enable Nordic's Device Manager, which brings in functionality from the |
LancasterUniversity | 615:65ea2acfc6a2 | 25 | * stack's Security Manager. The Security Manager implements the actual |
LancasterUniversity | 615:65ea2acfc6a2 | 26 | * cryptographic algorithms and protocol exchanges that allow two devices to |
LancasterUniversity | 615:65ea2acfc6a2 | 27 | * securely exchange data and privately detect each other. |
LancasterUniversity | 615:65ea2acfc6a2 | 28 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 29 | * @param[in] enableBonding Allow for bonding. |
LancasterUniversity | 615:65ea2acfc6a2 | 30 | * @param[in] requireMITM Require protection for man-in-the-middle attacks. |
LancasterUniversity | 615:65ea2acfc6a2 | 31 | * @param[in] iocaps To specify IO capabilities of this peripheral, |
LancasterUniversity | 615:65ea2acfc6a2 | 32 | * such as availability of a display or keyboard to |
LancasterUniversity | 615:65ea2acfc6a2 | 33 | * support out-of-band exchanges of security data. |
LancasterUniversity | 615:65ea2acfc6a2 | 34 | * @param[in] passkey To specify a static passkey. |
LancasterUniversity | 615:65ea2acfc6a2 | 35 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 36 | * @return BLE_ERROR_NONE on success. |
LancasterUniversity | 615:65ea2acfc6a2 | 37 | */ |
LancasterUniversity | 615:65ea2acfc6a2 | 38 | ble_error_t btle_initializeSecurity(bool enableBonding = true, |
LancasterUniversity | 615:65ea2acfc6a2 | 39 | bool requireMITM = true, |
LancasterUniversity | 615:65ea2acfc6a2 | 40 | SecurityManager::SecurityIOCapabilities_t iocaps = SecurityManager::IO_CAPS_NONE, |
LancasterUniversity | 615:65ea2acfc6a2 | 41 | const SecurityManager::Passkey_t passkey = NULL); |
LancasterUniversity | 615:65ea2acfc6a2 | 42 | |
LancasterUniversity | 615:65ea2acfc6a2 | 43 | /** |
LancasterUniversity | 615:65ea2acfc6a2 | 44 | * Get the security status of a link. |
LancasterUniversity | 615:65ea2acfc6a2 | 45 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 46 | * @param[in] connectionHandle |
LancasterUniversity | 615:65ea2acfc6a2 | 47 | * Handle to identify the connection. |
LancasterUniversity | 615:65ea2acfc6a2 | 48 | * @param[out] securityStatusP |
LancasterUniversity | 615:65ea2acfc6a2 | 49 | * security status. |
LancasterUniversity | 615:65ea2acfc6a2 | 50 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 51 | * @return BLE_SUCCESS Or appropriate error code indicating reason for failure. |
LancasterUniversity | 615:65ea2acfc6a2 | 52 | */ |
LancasterUniversity | 615:65ea2acfc6a2 | 53 | ble_error_t btle_getLinkSecurity(Gap::Handle_t connectionHandle, SecurityManager::LinkSecurityStatus_t *securityStatusP); |
LancasterUniversity | 615:65ea2acfc6a2 | 54 | |
LancasterUniversity | 615:65ea2acfc6a2 | 55 | /** |
LancasterUniversity | 615:65ea2acfc6a2 | 56 | * Function for deleting all peer device context and all related bonding |
LancasterUniversity | 615:65ea2acfc6a2 | 57 | * information from the database. |
LancasterUniversity | 615:65ea2acfc6a2 | 58 | * |
LancasterUniversity | 615:65ea2acfc6a2 | 59 | * @retval BLE_ERROR_NONE On success, else an error code indicating reason for failure. |
LancasterUniversity | 615:65ea2acfc6a2 | 60 | * @retval BLE_ERROR_INVALID_STATE If the API is called without module initialization and/or |
LancasterUniversity | 615:65ea2acfc6a2 | 61 | * application registration. |
LancasterUniversity | 615:65ea2acfc6a2 | 62 | */ |
LancasterUniversity | 615:65ea2acfc6a2 | 63 | ble_error_t btle_purgeAllBondingState(void); |
LancasterUniversity | 615:65ea2acfc6a2 | 64 | |
rgrover1 | 134:df7e7964a9c3 | 65 | #endif /* _BTLE_SECURITY_H_ */ |