true /* enable_snoop */, nullptr, avct_cb.mtu,
BTA_SEC_AUTHENTICATE);
- BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, BTA_SEC_AUTHENTICATE,
- AVCT_PSM);
-
/* Include the browsing channel which uses eFCR */
tL2CAP_ERTM_INFO ertm_info;
ertm_info.preferred_mode = avct_l2c_br_fcr_opts_def.mode;
true /*enable_snoop*/, &ertm_info, avct_cb.mtu_br,
BTA_SEC_AUTHENTICATE);
- /* AVCTP browsing channel uses the same security service as AVCTP control
- * channel */
- BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_AVCTP, BTA_SEC_AUTHENTICATE,
- AVCT_BR_PSM);
-
#if defined(AVCT_INITIAL_TRACE_LEVEL)
avct_cb.trace_level = AVCT_INITIAL_TRACE_LEVEL;
#else
#include "avct_int.h"
#include "bt_target.h"
#include "bt_utils.h"
+#include "bta/include/bta_api.h"
#include "btm_api.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_sec.h"
tAVCT_LCB* p_lcb = avct_lcb_by_bcb(p_bcb);
tL2CAP_ERTM_INFO ertm_info;
- BTM_SetOutService(p_lcb->peer_addr, BTM_SEC_SERVICE_AVCTP_BROWSE, 0);
-
/* Set the FCR options: Browsing channel mandates ERTM */
ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
ertm_info.allowed_modes = L2CAP_FCR_CHAN_OPT_ERTM;
/* call l2cap connect req */
p_bcb->ch_state = AVCT_CH_CONN;
- p_bcb->ch_lcid =
- L2CA_ErtmConnectReq(AVCT_BR_PSM, p_lcb->peer_addr, &ertm_info);
+ p_bcb->ch_lcid = L2CA_ErtmConnectReq2(AVCT_BR_PSM, p_lcb->peer_addr,
+ &ertm_info, BTA_SEC_AUTHENTICATE);
if (p_bcb->ch_lcid == 0) {
/* if connect req failed, send ourselves close event */
tAVCT_LCB_EVT avct_lcb_evt;
#include "bt_target.h"
#include "bt_types.h"
#include "bt_utils.h"
+#include "bta/include/bta_api.h"
#include "btm_api.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_sec.h"
void avct_lcb_chnl_open(tAVCT_LCB* p_lcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
uint16_t result = AVCT_RESULT_FAIL;
- BTM_SetOutService(p_lcb->peer_addr, BTM_SEC_SERVICE_AVCTP, 0);
- /* call l2cap connect req */
p_lcb->ch_state = AVCT_CH_CONN;
- p_lcb->ch_lcid = L2CA_ConnectReq(AVCT_PSM, p_lcb->peer_addr);
+ p_lcb->ch_lcid =
+ L2CA_ConnectReq2(AVCT_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE);
if (p_lcb->ch_lcid == 0) {
/* if connect req failed, send ourselves close event */
tAVCT_LCB_EVT avct_lcb_evt;
******************************************************************************/
extern void L2CA_FreeLePSM(uint16_t psm);
+extern uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
+ uint16_t sec_level);
/*******************************************************************************
*
* Function L2CA_ConnectReq
extern bool L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
uint16_t lcid, uint16_t result, uint16_t status);
+uint16_t L2CA_ErtmConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
+ tL2CAP_ERTM_INFO* p_ertm_info,
+ uint16_t sec_level);
+
/*******************************************************************************
*
* Function L2CA_ErtmConnectReq
l2cb.le_dyn_psm_assigned[psm - LE_DYNAMIC_PSM_START] = false;
}
+uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
+ uint16_t sec_level) {
+ BTM_SetSecurityLevel(true, "", 0, sec_level, psm, 0, 0);
+ return L2CA_ConnectReq(psm, p_bd_addr);
+}
+
/*******************************************************************************
*
* Function L2CA_ConnectReq
return L2CA_ErtmConnectReq(psm, p_bd_addr, nullptr);
}
+uint16_t L2CA_ErtmConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
+ tL2CAP_ERTM_INFO* p_ertm_info,
+ uint16_t sec_level) {
+ BTM_SetSecurityLevel(true, "", 0, sec_level, psm, 0, 0);
+ return L2CA_ErtmConnectReq(psm, p_bd_addr, p_ertm_info);
+}
+
/*******************************************************************************
*
* Function L2CA_ErtmConnectReq