#include "bnep_api.h"
#include <string.h>
#include "bnep_int.h"
+#include "bta/include/bta_api.h"
#include "stack/btm/btm_sec.h"
using bluetooth::Uuid;
*/
p_bcb->con_state = BNEP_STATE_CONN_START;
- BTM_SetOutService(p_rem_bda, BTM_SEC_SERVICE_BNEP_PANU, mx_chan_id);
- cid = L2CA_ConnectReq(BT_PSM_BNEP, p_bcb->rem_bda);
+ cid = L2CA_ConnectReq2(BT_PSM_BNEP, p_bcb->rem_bda,
+ BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
if (cid != 0) {
p_bcb->l2cap_cid = cid;
#include "bnep_int.h"
#include "bt_utils.h"
+#include "bta/include/bta_api.h"
#include "device/include/controller.h"
#include "osi/include/osi.h"
bnep_cb.reg_info.pL2CA_CongestionStatus_Cb = bnep_congestion_ind;
/* Now, register with L2CAP */
- if (!L2CA_Register(BT_PSM_BNEP, &bnep_cb.reg_info, false /* enable_snoop */,
- nullptr, bnep_cb.l2cap_my_cfg.mtu)) {
+ if (!L2CA_Register2(BT_PSM_BNEP, &bnep_cb.reg_info, false /* enable_snoop */,
+ nullptr, bnep_cb.l2cap_my_cfg.mtu,
+ BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT)) {
BNEP_TRACE_ERROR("BNEP - Registration failed");
return BNEP_SECURITY_FAIL;
}
UINT32_TO_BE_STREAM(p, NetAccessRate);
SDP_AddAttribute(sdp_handle, ATTR_ID_MAX_NET_ACCESS_RATE, UINT_DESC_TYPE, 4,
array);
-
- /* Register with Security Manager for the specific security level */
- if (!BTM_SimpleSetSecurityLevel(
- BTM_SEC_SERVICE_BNEP_NAP,
- BTM_SEC_IN_AUTHENTICATE | BTM_SEC_IN_ENCRYPT |
- BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT,
- BT_PSM_BNEP)) {
- PAN_TRACE_ERROR("PAN Security Registration failed for PANU");
- }
- }
-#endif
-#if (PAN_SUPPORTS_ROLE_GN == TRUE)
- if (uuid == UUID_SERVCLASS_GN) {
- if (!BTM_SimpleSetSecurityLevel(BTM_SEC_SERVICE_BNEP_GN, BTM_SEC_NONE,
- BT_PSM_BNEP)) {
- PAN_TRACE_ERROR("PAN Security Registration failed for GN");
- }
- }
-#endif
-#if (PAN_SUPPORTS_ROLE_PANU == TRUE)
- if (uuid == UUID_SERVCLASS_PANU) {
- if (!BTM_SimpleSetSecurityLevel(
- BTM_SEC_SERVICE_BNEP_PANU,
- BTM_SEC_IN_AUTHENTICATE | BTM_SEC_IN_ENCRYPT |
- BTM_SEC_OUT_AUTHENTICATE | BTM_SEC_OUT_ENCRYPT,
- BT_PSM_BNEP)) {
- PAN_TRACE_ERROR("PAN Security Registration failed for PANU");
- }
}
#endif