static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status);
static void bta_dm_disable_search_and_disc(void);
-#if (SMP_INCLUDED == TRUE)
static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, BD_ADDR bda,
tBTM_LE_EVT_DATA* p_data);
-#endif
static void bta_dm_ble_id_key_cback(uint8_t key_type,
tBTM_BLE_LOCAL_KEYS* p_key);
#if (BTA_GATT_INCLUDED == TRUE)
};
/* bta security callback */
-const tBTM_APPL_INFO bta_security = {
- &bta_dm_authorize_cback, &bta_dm_pin_cback, &bta_dm_new_link_key_cback,
- &bta_dm_authentication_complete_cback, &bta_dm_bond_cancel_complete_cback,
+const tBTM_APPL_INFO bta_security = {&bta_dm_authorize_cback,
+ &bta_dm_pin_cback,
+ &bta_dm_new_link_key_cback,
+ &bta_dm_authentication_complete_cback,
+ &bta_dm_bond_cancel_complete_cback,
#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE)
- &bta_dm_sp_cback
+ &bta_dm_sp_cback,
#else
- NULL
-#endif
-#if (SMP_INCLUDED == TRUE)
- ,
- &bta_dm_ble_smp_cback
+ NULL
#endif
- ,
- &bta_dm_ble_id_key_cback};
+ &bta_dm_ble_smp_cback,
+ &bta_dm_ble_id_key_cback};
#define MAX_DISC_RAW_DATA_BUF (4096)
uint8_t g_disc_raw_data_buf[MAX_DISC_RAW_DATA_BUF];
}
}
-#if (SMP_INCLUDED == TRUE)
/*******************************************************************************
*
* Function bta_dm_ble_smp_cback
}
return status;
}
-#endif /* SMP_INCLUDED == TRUE */
/*******************************************************************************
*
uint8_t level_flags; /* indicates individual flags */
} tBTA_DM_BUSY_LEVEL;
-#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
-#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
-#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
-#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
-#if (SMP_INCLUDED == TRUE)
+#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
+#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
+#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
+#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
-#endif
typedef tBTM_IO_CAP tBTA_IO_CAP;
#define BTA_AUTH_SP_NO \
#include "bte_appl.h"
tBTE_APPL_CFG bte_appl_cfg = {
-#if (SMP_INCLUDED == TRUE)
BTA_LE_AUTH_REQ_SC_MITM_BOND, // Authentication requirements
-#else
- BTM_AUTH_SPGB_YES, // Authentication requirements
-#endif
BTM_LOCAL_IO_CAPS_BLE, BTM_BLE_INITIATOR_KEY_SIZE,
BTM_BLE_RESPONDER_KEY_SIZE, BTM_BLE_MAX_KEY_SIZE};
* SMP
*
*****************************************************************************/
-#ifndef SMP_INCLUDED
-#define SMP_INCLUDED TRUE
-#endif
-
#ifndef SMP_DEBUG
#define SMP_DEBUG FALSE
#endif
#endif
typedef struct {
-#if (SMP_INCLUDED == TRUE)
uint8_t ble_auth_req;
uint8_t ble_io_cap;
uint8_t ble_init_key;
uint8_t ble_resp_key;
uint8_t ble_max_key_size;
-#endif
} tBTE_APPL_CFG;
extern tBTE_APPL_CFG bte_appl_cfg;
#endif
#include "gatt_api.h"
-#if (SMP_INCLUDED == TRUE)
#include "smp_api.h"
-#endif
/*****************************************************************************
** F U N C T I O N S *
#include "osi/include/osi.h"
#include "smp_api.h"
-#if (SMP_INCLUDED == TRUE)
extern bool aes_cipher_msg_auth_code(BT_OCTET16 key, uint8_t *input, uint16_t length,
uint16_t tlen, uint8_t *p_signature);
-#endif
/*******************************************************************************/
/* External Function to be called by other modules */
*******************************************************************************/
bool BTM_SecAddBleKey (BD_ADDR bd_addr, tBTM_LE_KEY_VALUE *p_le_key, tBTM_LE_KEY_TYPE key_type)
{
-#if (SMP_INCLUDED == TRUE)
tBTM_SEC_DEV_REC *p_dev_rec;
BTM_TRACE_DEBUG ("BTM_SecAddBleKey");
p_dev_rec = btm_find_dev (bd_addr);
btm_ble_resolving_list_load_dev (p_dev_rec);
#endif
-#endif
-
return(true);
}
*******************************************************************************/
void BTM_SecurityGrant(BD_ADDR bd_addr, uint8_t res)
{
-#if (SMP_INCLUDED == TRUE)
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_REPEATED_ATTEMPTS;
BTM_TRACE_DEBUG ("BTM_SecurityGrant");
SMP_SecurityGrant(bd_addr, res_smp);
-#endif
}
/*******************************************************************************
*******************************************************************************/
void BTM_BlePasskeyReply (BD_ADDR bd_addr, uint8_t res, uint32_t passkey)
{
-#if (SMP_INCLUDED == TRUE)
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL;
p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED;
BTM_TRACE_DEBUG ("BTM_BlePasskeyReply");
SMP_PasskeyReply(bd_addr, res_smp, passkey);
-#endif
}
/*******************************************************************************
*******************************************************************************/
void BTM_BleOobDataReply(BD_ADDR bd_addr, uint8_t res, uint8_t len, uint8_t *p_data)
{
-#if (SMP_INCLUDED == TRUE)
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_OOB_FAIL;
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
p_dev_rec->sec_flags |= BTM_SEC_LE_AUTHENTICATED;
SMP_OobDataReply(bd_addr, res_smp, len, p_data);
-#endif
}
/*******************************************************************************
void BTM_BleSecureConnectionOobDataReply(BD_ADDR bd_addr,
uint8_t *p_c, uint8_t *p_r)
{
-#if SMP_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
BTM_TRACE_DEBUG ("%s:", __func__);
memcpy(&oob.peer_oob_data.addr_rcvd_from.bda, bd_addr, sizeof(BD_ADDR));
SMP_SecureConnectionOobDataReply((uint8_t*)&oob);
-#endif
}
/******************************************************************************
*******************************************************************************/
void BTM_BleSetConnScanParams (uint32_t scan_interval, uint32_t scan_window)
{
-#if (SMP_INCLUDED == TRUE)
tBTM_BLE_CB *p_ble_cb = &btm_cb.ble_ctr_cb;
bool new_param = false;
{
BTM_TRACE_ERROR("Illegal Connection Scan Parameters");
}
-#endif
}
/********************************************************
}
}
- #if (SMP_INCLUDED == true)
-
/*******************************************************************************
**
** Function btm_ble_get_enc_key_type
return 0;
}
- #endif /* SMP_INCLUDED */
-
/*******************************************************************************
**
** Function BTM_BleDataSignature
uint8_t *p_comp)
{
bool verified = false;
-#if (SMP_INCLUDED == TRUE)
tBTM_SEC_DEV_REC *p_rec = btm_find_dev (bd_addr);
uint8_t p_mac[BTM_CMAC_TLEN_SIZE];
}
}
}
-#endif /* SMP_INCLUDED */
return verified;
}
*p_le_dev_sec_flags = 0;
*p_le_key_size = 0;
-#if (SMP_INCLUDED == TRUE)
if ((p_dev_rec = btm_find_dev (bd_addr)) == NULL)
{
BTM_TRACE_ERROR ("%s fails", __func__);
__func__, *p_le_dev_sec_flags, *p_le_key_size);
return true;
-#else
- return false;
-#endif
}
/*******************************************************************************
*******************************************************************************/
static void btm_ble_process_dhk(tSMP_ENC *p)
{
-#if (SMP_INCLUDED == TRUE)
uint8_t btm_ble_irk_pt = 0x01;
tSMP_ENC output;
/* reset all identity root related key */
memset(&btm_cb.devcb.id_keys, 0, sizeof(tBTM_BLE_LOCAL_ID_KEYS));
}
-#endif
}
/*******************************************************************************
*******************************************************************************/
static void btm_ble_process_ir2(tBTM_RAND_ENC *p)
{
-#if (SMP_INCLUDED == TRUE)
uint8_t btm_ble_dhk_pt = 0x03;
tSMP_ENC output;
{
memset(&btm_cb.devcb.id_keys, 0, sizeof(tBTM_BLE_LOCAL_ID_KEYS));
}
-#endif
}
/*******************************************************************************
*******************************************************************************/
void btm_gen_resolve_paddr_low(tBTM_RAND_ENC *p)
{
-#if (SMP_INCLUDED == TRUE)
tBTM_LE_RANDOM_CB *p_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
tSMP_ENC output;
btm_gen_resolve_paddr_cmpl(&output);
}
}
-#endif
}
/*******************************************************************************
**
btsnd_hcic_ble_rand((void *)btm_gen_non_resolve_paddr_cmpl);
}
-#if (SMP_INCLUDED == TRUE)
/*******************************************************************************
** Utility functions for Random address resolving
*******************************************************************************/
*******************************************************************************/
static bool btm_ble_match_random_bda(void *data, void *context)
{
-#if (SMP_INCLUDED == TRUE)
/* use the 3 MSB of bd address as prand */
tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
&rand[0], 3, &output);
// if it was match, finish iteration, otherwise continue
return !btm_ble_proc_resolve_x(&output);
-#endif
}
/*******************************************************************************
(*p_cback)(NULL, p);
}
}
-#endif
/*******************************************************************************
** address mapping between pseudo address and real connection address
#include "hcidefs.h"
#include "btm_ble_api.h"
#include "btm_int.h"
-
-#if (SMP_INCLUDED == TRUE)
#include "smp_api.h"
-#endif
-
#include "btm_ble_int_types.h"
#ifdef __cplusplus
extern void btm_ble_create_ll_conn_complete (uint8_t status);
/* LE security function from btm_sec.cc */
-#if (SMP_INCLUDED == TRUE)
extern void btm_ble_link_sec_check(BD_ADDR bd_addr, tBTM_LE_AUTH_REQ auth_req, tBTM_BLE_SEC_REQ_ACT *p_sec_req_act);
extern void btm_ble_ltk_request_reply(BD_ADDR bda, bool use_stk, BT_OCTET16 stk);
extern uint8_t btm_proc_smp_cback(tSMP_EVT event, BD_ADDR bd_addr, tSMP_EVT_DATA *p_data);
extern void btm_ble_ltk_request(uint16_t handle, uint8_t rand[8], uint16_t ediv);
extern tBTM_STATUS btm_ble_start_encrypt(BD_ADDR bda, bool use_stk, BT_OCTET16 stk);
extern void btm_ble_link_encrypted(BD_ADDR bd_addr, uint8_t encr_enable);
-#endif
/* LE device management functions */
extern void btm_ble_reset_id( void );
}
void OnRpaGenerationComplete(uint8_t inst_id, tBTM_RAND_ENC *p) {
-#if (SMP_INCLUDED == TRUE)
LOG(INFO) << "inst_id = " << +inst_id;
AdvertisingInstance *p_inst = &adv_inst[inst_id];
/* set it to controller */
GetHciInterface()->SetRandomAddress(p_inst->rpa, p_inst->inst_id,
Bind(DoNothing));
-#endif
}
void ConfigureRpa(uint8_t inst_id) {
#include "osi/include/fixed_queue.h"
#include "btm_api.h"
-
#include "btm_ble_int.h"
-#if (SMP_INCLUDED == TRUE)
-#include "smp_api.h"
-#endif
-
#include "btm_int_types.h"
+#include "smp_api.h"
#ifdef __cplusplus
extern "C" {
uint8_t active_addr_type;
#endif
-#if (SMP_INCLUDED == TRUE)
tBTM_LE_KEY_TYPE key_type; /* bit mask of valid key types in record */
tBTM_SEC_BLE_KEYS keys; /* LE device security info in slave rode */
-#endif
} tBTM_SEC_BLE;
/* Peering bond type */
BTM_TRACE_EVENT("%s application registered", __func__);
-#if (SMP_INCLUDED == TRUE)
LOG_INFO(LOG_TAG, "%s p_cb_info->p_le_callback == 0x%p", __func__, p_cb_info->p_le_callback);
if (p_cb_info->p_le_callback)
{
{
LOG_WARN(LOG_TAG, "%s p_cb_info->p_le_callback == NULL", __func__);
}
-#endif /* (SMP_INCLUDED == TRUE) */
btm_cb.api = *p_cb_info;
-#if (SMP_INCLUDED == TRUE)
- LOG_INFO(LOG_TAG, "%s btm_cb.api.p_le_callback = 0x%p ", __func__, btm_cb.api.p_le_callback);
-#endif
+ LOG_INFO(LOG_TAG, "%s btm_cb.api.p_le_callback = 0x%p ", __func__, btm_cb.api.p_le_callback);
BTM_TRACE_EVENT("%s application registered", __func__);
return(true);
}
if (trusted_mask)
BTM_SEC_COPY_TRUSTED_DEVICE(trusted_mask, p_dev_rec->trusted_mask);
-#if (SMP_INCLUDED == TRUE)
if (transport == BT_TRANSPORT_LE)
{
btm_ble_init_pseudo_addr (p_dev_rec, bd_addr);
btm_cb.pairing_flags = 0;
return(BTM_NO_RESOURCES);
}
-#endif
p_dev_rec->sec_flags &= ~(BTM_SEC_LINK_KEY_KNOWN | BTM_SEC_AUTHENTICATED | BTM_SEC_ENCRYPTED
| BTM_SEC_ROLE_SWITCHED | BTM_SEC_LINK_KEY_AUTHED);
tBTM_STATUS BTM_SecBondByTransport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
uint8_t pin_len, uint8_t *p_pin, uint32_t trusted_mask[])
{
-#if (SMP_INCLUDED == TRUE)
tBT_DEVICE_TYPE dev_type;
tBLE_ADDR_TYPE addr_type;
{
return BTM_ILLEGAL_ACTION;
}
-#endif
return btm_sec_bond_by_transport(bd_addr, transport, pin_len, p_pin, trusted_mask);
}
|| (memcmp (btm_cb.pairing_bda, bd_addr, BD_ADDR_LEN) != 0) )
return BTM_UNKNOWN_ADDR;
-#if (SMP_INCLUDED == TRUE)
if (btm_cb.pairing_flags & BTM_PAIR_FLAGS_LE_ACTIVE)
{
if (p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING)
return BTM_WRONG_MODE;
}
-#endif
BTM_TRACE_DEBUG ("hci_handle:0x%x sec_state:%d", p_dev_rec->hci_handle, p_dev_rec->sec_state );
if (BTM_PAIR_STATE_WAIT_LOCAL_PIN == btm_cb.pairing_state &&
BTM_PAIR_FLAGS_WE_STARTED_DD & btm_cb.pairing_flags)
p_dev_rec->hci_handle, p_dev_rec->sec_state, p_dev_rec->sec_flags,
p_dev_rec->security_required);
-#if (SMP_INCLUDED == TRUE)
if (transport == BT_TRANSPORT_LE)
{
tACL_CONN *p = btm_bda_to_acl(bd_addr, transport);
}
}
else
-#endif
+ {
rc = btm_sec_execute_procedure (p_dev_rec);
+ }
if (rc != BTM_CMD_STARTED && rc != BTM_BUSY)
{
p_dev_rec->sec_state = BTM_SEC_STATE_DISCONNECTING_BOTH;
break;
-#if (SMP_INCLUDED == TRUE)
case BTM_SEC_STATE_DISCONNECTING_BLE:
if (conn_handle == p_dev_rec->ble_hci_handle)
return status;
case BTM_SEC_STATE_DISCONNECTING_BOTH:
return status;
-#endif
default:
p_dev_rec->sec_state = (conn_handle == p_dev_rec->hci_handle) ?
void btm_sec_encrypt_change (uint16_t handle, uint8_t status, uint8_t encr_enable)
{
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_handle (handle);
-#if (SMP_INCLUDED == TRUE)
tACL_CONN *p_acl = NULL;
uint8_t acl_idx = btm_handle_to_acl_index(handle);
-#endif
BTM_TRACE_EVENT ("Security Manager: encrypt_change status:%d State:%d, encr_enable = %d",
status, (p_dev_rec) ? p_dev_rec->sec_state : 0, encr_enable);
BTM_TRACE_DEBUG ("before update p_dev_rec->sec_flags=0x%x", (p_dev_rec) ? p_dev_rec->sec_flags : 0 );
BTM_TRACE_DEBUG ("after update p_dev_rec->sec_flags=0x%x", p_dev_rec->sec_flags );
-#if (SMP_INCLUDED == TRUE)
if (acl_idx != MAX_L2CAP_LINKS)
p_acl = &btm_cb.acl_db[acl_idx];
}
}
}
-#else
- btm_sec_check_pending_enc_req (p_dev_rec, BT_TRANSPORT_BR_EDR, encr_enable);
-#endif /* SMP_INCLUDED == TRUE */
/* If this encryption was started by peer do not need to do anything */
if (p_dev_rec->sec_state != BTM_SEC_STATE_ENCRYPTING)
}
}
-#if (SMP_INCLUDED == TRUE)
btm_ble_update_mode_operation(HCI_ROLE_UNKNOWN, p_dev_rec->bd_addr, HCI_SUCCESS);
/* see sec_flags processing in btm_acl_removed */
p_dev_rec->enc_key_size = 0;
}
else
-#endif
{
p_dev_rec->hci_handle = BTM_SEC_INVALID_HANDLE;
p_dev_rec->sec_flags &= ~(BTM_SEC_AUTHORIZED | BTM_SEC_AUTHENTICATED | BTM_SEC_ENCRYPTED
| BTM_SEC_ROLE_SWITCHED | BTM_SEC_16_DIGIT_PIN_AUTHED);
}
-#if (SMP_INCLUDED == TRUE)
if (p_dev_rec->sec_state == BTM_SEC_STATE_DISCONNECTING_BOTH)
{
p_dev_rec->sec_state = (transport == BT_TRANSPORT_LE) ?
BTM_SEC_STATE_DISCONNECTING : BTM_SEC_STATE_DISCONNECTING_BLE;
return;
}
-#endif
p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
p_dev_rec->security_required = BTM_SEC_NONE;
{
BTM_TRACE_DEBUG ("%s() Clearing BLE Keys", __func__);
-#if (SMP_INCLUDED == TRUE)
p_dev_rec->ble.key_type = BTM_LE_KEY_NONE;
memset (&p_dev_rec->ble.keys, 0, sizeof(tBTM_SEC_BLE_KEYS));
#if (BLE_PRIVACY_SPT == TRUE)
btm_ble_resolving_list_remove_dev(p_dev_rec);
#endif
-#endif
}
/*******************************************************************************
bool is_bonded= false;
if (p_dev_rec &&
-#if (SMP_INCLUDED == TRUE)
((p_dev_rec->ble.key_type && (p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN))||
-#else
- (
-#endif
(p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN)))
{
is_bonded = true;
STREAM_TO_UINT16(handle, p);
pp = p + 8;
STREAM_TO_UINT16(ediv, pp);
-#if (SMP_INCLUDED == TRUE)
btm_ble_ltk_request(handle, p, ediv);
-#endif
/* This is empty until an upper layer cares about returning event */
}
#include "osi/include/log.h"
#include "osi/include/thread.h"
#include "sdpint.h"
-
-#if (SMP_INCLUDED == TRUE)
#include "smp_int.h"
-#endif
// Increase BTU task thread priority to avoid pre-emption
// of audio realated tasks.
sdp_init();
gatt_init();
-#if (SMP_INCLUDED == TRUE)
+
SMP_Init();
-#endif
+
btm_ble_init();
}
#include "bta_sys.h"
#include "btm_ble_int.h"
#include "gatt_int.h"
-
-#if (SMP_INCLUDED == TRUE)
#include "smp_int.h"
-#endif
#define BTM_IO_CAP_IO 1 /* DisplayYesNo */
#define BTM_IO_CAP_IN 2 /* KeyboardOnly */
#define BTM_IO_CAP_NONE 3 /* NoInputNoOutput */
-#if (SMP_INCLUDED == TRUE)
#define BTM_IO_CAP_KBDISP 4 /* Keyboard display */
#define BTM_IO_CAP_MAX 5
-#else
-#define BTM_IO_CAP_MAX 4
-#endif
typedef uint8_t tBTM_IO_CAP;
tBTM_LE_KEY_TYPE resp_keys; /* keys to be distributed, bit mask */
} tBTM_LE_IO_REQ;
-#if (SMP_INCLUDED == TRUE)
/* data type for tBTM_LE_COMPLT */
typedef struct
{
bool is_pair_cancel;
bool smp_over_br;
}tBTM_LE_COMPLT;
-#endif
/* BLE encryption keys */
typedef struct
/* BTM_LE_NC_REQ_EVT */
/* no callback data for BTM_LE_KEY_REQ_EVT */
/* and BTM_LE_OOB_REQ_EVT */
-#if (SMP_INCLUDED == TRUE)
tBTM_LE_COMPLT complt; /* BTM_LE_COMPLT_EVT */
tSMP_OOB_DATA_TYPE req_oob_type;
-#endif
tBTM_LE_KEY key;
} tBTM_LE_EVT_DATA;
tBTM_AUTH_COMPLETE_CALLBACK *p_auth_complete_callback;
tBTM_BOND_CANCEL_CMPL_CALLBACK *p_bond_cancel_cmpl_callback;
tBTM_SP_CALLBACK *p_sp_callback;
-#if (SMP_INCLUDED == TRUE)
tBTM_LE_CALLBACK *p_le_callback;
-#endif
tBTM_LE_KEY_CALLBACK *p_le_key_callback;
} tBTM_APPL_INFO;
*******************************************************************************/
extern bool SMP_CreateLocalSecureConnectionsOobData(tBLE_BD_ADDR *addr_to_send_to);
-#if (SMP_INCLUDED == TRUE)
// Called when LTK request is received from controller.
extern bool smp_proc_ltk_request(BD_ADDR bda);
// Called when link is encrypted and notified to slave device.
// Proceed to send LTK, DIV and ER to master if bonding the devices.
extern void smp_link_encrypted(BD_ADDR bda, uint8_t encr_enable);
-#endif /* SMP_INCLUDED == TRUE */
//
// The AES-CMAC Generation Function with tlen implemented.
#define SMP_PIN_CODE_LEN_MAX PIN_CODE_LEN
#define SMP_PIN_CODE_LEN_MIN 6
-#if (SMP_INCLUDED == TRUE)
/* SMP command code */
#define SMP_OPCODE_PAIRING_REQ 0x01
#define SMP_OPCODE_PAIRING_RSP 0x02
#define SMP_OPCODE_MAX SMP_OPCODE_PAIR_KEYPR_NOTIF
#define SMP_OPCODE_MIN SMP_OPCODE_PAIRING_REQ
#define SMP_OPCODE_PAIR_COMMITM 0x0F
-#endif
/* SMP event type */
#define SMP_IO_CAP_REQ_EVT 1 /* IO capability request event */
extern fixed_queue_t *btu_general_alarm_queue;
-#if (SMP_INCLUDED == TRUE)
-
#define SMP_KEY_DIST_TYPE_MAX 4
const tSMP_ACT smp_distribute_act [] =
{
smp_proc_pairing_cmpl(p_cb);
}
}
-
-#endif
#include "bt_utils.h"
#include "stack_config.h"
-#if (SMP_INCLUDED == TRUE)
- #include "smp_int.h"
- #include "smp_api.h"
- #include "l2cdefs.h"
- #include "l2c_int.h"
- #include "btm_int.h"
- #include "hcimsgs.h"
+#include "smp_int.h"
+#include "smp_api.h"
+#include "l2cdefs.h"
+#include "l2c_int.h"
+#include "btm_int.h"
+#include "hcimsgs.h"
- #include "btu.h"
- #include "p_256_ecc_pp.h"
+#include "btu.h"
+#include "p_256_ecc_pp.h"
/*******************************************************************************
**
return true;
}
-
-#endif /* SMP_INCLUDED */
#include "bt_target.h"
-#if (SMP_INCLUDED == TRUE)
- #include <stdio.h>
- #include <string.h>
+#include <stdio.h>
+#include <string.h>
- #include "btm_ble_api.h"
- #include "smp_int.h"
- #include "hcimsgs.h"
+#include "btm_ble_api.h"
+#include "smp_int.h"
+#include "hcimsgs.h"
typedef struct
{
return ret;
}
-
-#endif
-
******************************************************************************/
#include "bt_target.h"
-#if (SMP_INCLUDED == TRUE)
#if (SMP_DEBUG == TRUE)
#include <stdio.h>
#endif
SMP_TRACE_ERROR("%s key generation failed: (%d)", __func__, p_cb->rand_enc_proc_state);
smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &failure);
}
-
-#endif
-
#include "bt_target.h"
-#if (SMP_INCLUDED == TRUE)
-
#include <string.h>
#include "btm_ble_api.h"
#include "l2c_api.h"
osi_free(p_buf);
}
-#endif /* SMP_INCLUDED == TRUE */
#include "bt_target.h"
-#if (SMP_INCLUDED == TRUE)
-
#include <string.h>
#include "smp_int.h"
}
return p_str;
}
-
-#endif
-
******************************************************************************/
#include "bt_target.h"
-#if (SMP_INCLUDED == TRUE)
-
#include "bt_types.h"
#include "bt_utils.h"
#include <string.h>
return true;
}
-
-
-#endif
-