MYNEWT-346 BLE Host - Add BLE_SM_LEGACY setting.

X-Original-Commit: 42d981f282369a3d9d3ee4c35dea8abfee9effd8
This commit is contained in:
Christopher Collins
2016-12-09 13:34:35 -06:00
parent 2c89b0263a
commit add67fa508
6 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
#include "host/ble_sm.h"
#include "ble_hs_priv.h"
#if MYNEWT_VAL(BLE_SM)
#if NIMBLE_BLE_SM
/** Procedure timeout; 30 seconds. */
#define BLE_SM_TIMEOUT_OS_TICKS (30 * OS_TICKS_PER_SEC)
+2 -1
View File
@@ -21,8 +21,9 @@
#include <inttypes.h>
#include <string.h>
#include "syscfg/syscfg.h"
#include "nimble/nimble_opt.h"
#if MYNEWT_VAL(BLE_SM)
#if NIMBLE_BLE_SM
#include "nimble/ble.h"
#include "nimble/nimble_opt.h"
+1 -1
View File
@@ -25,7 +25,7 @@
#include "host/ble_sm.h"
#include "ble_hs_priv.h"
#if NIMBLE_BLE_SM
#if MYNEWT_VAL(BLE_SM_LEGACY)
/**
* Create some shortened names for the passkey actions so that the table is
+7
View File
@@ -403,6 +403,7 @@ void ble_sm_enc_change_rx(struct hci_encrypt_change *evt);
void ble_sm_enc_key_refresh_rx(struct hci_encrypt_key_refresh *evt);
int ble_sm_ltk_req_rx(struct hci_le_lt_key_req *evt);
#if MYNEWT_VAL(BLE_SM_LEGACY)
int ble_sm_lgcy_io_action(struct ble_sm_proc *proc);
void ble_sm_lgcy_confirm_exec(struct ble_sm_proc *proc,
struct ble_sm_result *res);
@@ -410,6 +411,12 @@ void ble_sm_lgcy_random_exec(struct ble_sm_proc *proc,
struct ble_sm_result *res);
void ble_sm_lgcy_random_rx(struct ble_sm_proc *proc,
struct ble_sm_result *res);
#else
#define ble_sm_lgcy_io_action(proc) (BLE_HS_ENOTSUP)
#define ble_sm_lgcy_confirm_exec(proc, res)
#define ble_sm_lgcy_random_exec(proc, res)
#define ble_sm_lgcy_random_rx(proc, res)
#endif
#if MYNEWT_VAL(BLE_SM_SC)
int ble_sm_sc_io_action(struct ble_sm_proc *proc);
+1 -1
View File
@@ -50,7 +50,7 @@ syscfg.defs:
value: 30000
# Security manager settings.
BLE_SM:
BLE_SM_LEGACY:
description: 'Security manager legacy pairing.'
value: 1
BLE_SM_SC:
+3 -10
View File
@@ -21,7 +21,6 @@
#define H_NIMBLE_OPT_AUTO_
#include "syscfg/syscfg.h"
#include "nimble/nimble_opt.h"
#ifdef __cplusplus
extern "C" {
@@ -30,8 +29,8 @@ extern "C" {
/***
* Automatic options.
*
* These settings are generated automatically from the user-specified settings
* in nimble_opt.h.
* These settings are generated automatically from the user-specified syscfg
* settings.
*/
#undef NIMBLE_BLE_ADVERTISE
@@ -108,14 +107,8 @@ extern "C" {
/** Security manager settings. */
/* Secure connections implies security manager support
* Note: For now, security manager is synonymous with legacy pairing. In the
* future, a new setting for legacy pairing may be introduced as a sibling of
* the SC setting.
*/
#undef NIMBLE_BLE_SM
#define NIMBLE_BLE_SM (MYNEWT_VAL(BLE_SM) || MYNEWT_VAL(BLE_SM_SC))
#define NIMBLE_BLE_SM (MYNEWT_VAL(BLE_SM_LEGACY) || MYNEWT_VAL(BLE_SM_SC))
#ifdef __cplusplus
}