test
Fork of nRF51822 by
Embed:
(wiki syntax)
Show/hide line numbers
btle_security.h
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2006-2013 ARM Limited 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _BTLE_SECURITY_H_ 00018 #define _BTLE_SECURITY_H_ 00019 00020 #include "ble/Gap.h" 00021 #include "ble/SecurityManager.h" 00022 00023 /** 00024 * Enable Nordic's Device Manager, which brings in functionality from the 00025 * stack's Security Manager. The Security Manager implements the actual 00026 * cryptographic algorithms and protocol exchanges that allow two devices to 00027 * securely exchange data and privately detect each other. 00028 * 00029 * @param[in] enableBonding Allow for bonding. 00030 * @param[in] requireMITM Require protection for man-in-the-middle attacks. 00031 * @param[in] iocaps To specify IO capabilities of this peripheral, 00032 * such as availability of a display or keyboard to 00033 * support out-of-band exchanges of security data. 00034 * @param[in] passkey To specify a static passkey. 00035 * 00036 * @return BLE_ERROR_NONE on success. 00037 */ 00038 ble_error_t btle_initializeSecurity(bool enableBonding = true, 00039 bool requireMITM = true, 00040 SecurityManager::SecurityIOCapabilities_t iocaps = SecurityManager::IO_CAPS_NONE, 00041 const SecurityManager::Passkey_t passkey = NULL); 00042 00043 /** 00044 * Get the security status of a link. 00045 * 00046 * @param[in] connectionHandle 00047 * Handle to identify the connection. 00048 * @param[out] securityStatusP 00049 * security status. 00050 * 00051 * @return BLE_SUCCESS Or appropriate error code indicating reason for failure. 00052 */ 00053 ble_error_t btle_getLinkSecurity(Gap::Handle_t connectionHandle, SecurityManager::LinkSecurityStatus_t *securityStatusP); 00054 00055 /** 00056 * Function for deleting all peer device context and all related bonding 00057 * information from the database. 00058 * 00059 * @retval BLE_ERROR_NONE On success, else an error code indicating reason for failure. 00060 * @retval BLE_ERROR_INVALID_STATE If the API is called without module initialization and/or 00061 * application registration. 00062 */ 00063 ble_error_t btle_purgeAllBondingState(void); 00064 00065 #endif /* _BTLE_SECURITY_H_ */
Generated on Tue Jul 12 2022 21:00:16 by 1.7.2