Loading system/stack/hid/hidh_api.cc +4 −22 Original line number Diff line number Diff line Loading @@ -463,43 +463,25 @@ tHID_STATUS HID_HostCloseDev(uint8_t dev_handle) { tHID_STATUS HID_HostSetSecurityLevel(const char serv_name[], uint8_t sec_lvl) { if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_SEC_CTRL, sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN)) { sec_lvl, HID_PSM_CONTROL, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 1 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_SEC_CTRL, sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN)) { sec_lvl, HID_PSM_CONTROL, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 2 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_NOSEC_CTRL, BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN)) { HIDH_TRACE_ERROR("Security Registration 3 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_NOSEC_CTRL, BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN)) { HIDH_TRACE_ERROR("Security Registration 4 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_INTR, BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0)) { BTM_SEC_NONE, HID_PSM_INTERRUPT, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 5 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_INTR, BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0)) { BTM_SEC_NONE, HID_PSM_INTERRUPT, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 6 failed"); return (HID_ERR_NO_RESOURCES); } Loading system/stack/hid/hidh_conn.cc +6 −12 Original line number Diff line number Diff line Loading @@ -261,14 +261,9 @@ static void hidh_l2cif_connect_ind(const RawAddress& bd_addr, to 'connection failure' */ p_hcon->conn_state = HID_CONN_STATE_SECURITY; if (btm_sec_mx_access_request( p_dev->addr, HID_PSM_CONTROL, false, BTM_SEC_PROTO_HID, (p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN, &hidh_sec_check_complete_term, p_dev) == BTM_CMD_STARTED) { L2CA_ConnectRsp(bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_PENDING, L2CAP_CONN_OK); } // Assume security check ok hidh_sec_check_complete_term(nullptr, BT_TRANSPORT_BR_EDR, p_dev, BTM_SUCCESS); return; } Loading Loading @@ -428,10 +423,9 @@ static void hidh_l2cif_connect_cfm(uint16_t l2cap_cid, uint16_t result) { then set CLOSE_EVT reason code to "connection failure" */ btm_sec_mx_access_request( p_dev->addr, HID_PSM_CONTROL, true, BTM_SEC_PROTO_HID, (p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN, &hidh_sec_check_complete_orig, p_dev); // Assume security check ok hidh_sec_check_complete_orig(nullptr, BT_TRANSPORT_BR_EDR, p_dev, BTM_SUCCESS); } else { p_hcon->conn_state = HID_CONN_STATE_CONFIG; /* Send a Configuration Request. */ Loading Loading
system/stack/hid/hidh_api.cc +4 −22 Original line number Diff line number Diff line Loading @@ -463,43 +463,25 @@ tHID_STATUS HID_HostCloseDev(uint8_t dev_handle) { tHID_STATUS HID_HostSetSecurityLevel(const char serv_name[], uint8_t sec_lvl) { if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_SEC_CTRL, sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN)) { sec_lvl, HID_PSM_CONTROL, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 1 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_SEC_CTRL, sec_lvl, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_SEC_CHN)) { sec_lvl, HID_PSM_CONTROL, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 2 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_NOSEC_CTRL, BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN)) { HIDH_TRACE_ERROR("Security Registration 3 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_NOSEC_CTRL, BTM_SEC_NONE, HID_PSM_CONTROL, BTM_SEC_PROTO_HID, HID_NOSEC_CHN)) { HIDH_TRACE_ERROR("Security Registration 4 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(true, serv_name, BTM_SEC_SERVICE_HIDH_INTR, BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0)) { BTM_SEC_NONE, HID_PSM_INTERRUPT, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 5 failed"); return (HID_ERR_NO_RESOURCES); } if (!BTM_SetSecurityLevel(false, serv_name, BTM_SEC_SERVICE_HIDH_INTR, BTM_SEC_NONE, HID_PSM_INTERRUPT, BTM_SEC_PROTO_HID, 0)) { BTM_SEC_NONE, HID_PSM_INTERRUPT, 0, 0)) { HIDH_TRACE_ERROR("Security Registration 6 failed"); return (HID_ERR_NO_RESOURCES); } Loading
system/stack/hid/hidh_conn.cc +6 −12 Original line number Diff line number Diff line Loading @@ -261,14 +261,9 @@ static void hidh_l2cif_connect_ind(const RawAddress& bd_addr, to 'connection failure' */ p_hcon->conn_state = HID_CONN_STATE_SECURITY; if (btm_sec_mx_access_request( p_dev->addr, HID_PSM_CONTROL, false, BTM_SEC_PROTO_HID, (p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN, &hidh_sec_check_complete_term, p_dev) == BTM_CMD_STARTED) { L2CA_ConnectRsp(bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_PENDING, L2CAP_CONN_OK); } // Assume security check ok hidh_sec_check_complete_term(nullptr, BT_TRANSPORT_BR_EDR, p_dev, BTM_SUCCESS); return; } Loading Loading @@ -428,10 +423,9 @@ static void hidh_l2cif_connect_cfm(uint16_t l2cap_cid, uint16_t result) { then set CLOSE_EVT reason code to "connection failure" */ btm_sec_mx_access_request( p_dev->addr, HID_PSM_CONTROL, true, BTM_SEC_PROTO_HID, (p_dev->attr_mask & HID_SEC_REQUIRED) ? HID_SEC_CHN : HID_NOSEC_CHN, &hidh_sec_check_complete_orig, p_dev); // Assume security check ok hidh_sec_check_complete_orig(nullptr, BT_TRANSPORT_BR_EDR, p_dev, BTM_SUCCESS); } else { p_hcon->conn_state = HID_CONN_STATE_CONFIG; /* Send a Configuration Request. */ Loading