Loading system/main/shim/l2c_api.cc +10 −0 Original line number Diff line number Diff line Loading @@ -334,6 +334,7 @@ struct RemoteFeature { uint8_t lmp_version = 0; uint16_t manufacturer_name = 0; uint16_t sub_version = 0; uint8_t raw_remote_features[8]; bool version_info_received = false; bool role_switch_supported = false; bool ssp_supported = false; Loading Loading @@ -375,6 +376,7 @@ struct LinkPropertyListenerShim if (page_number == 0) { entry.received_page_0 = true; if (features & 0x20) entry.role_switch_supported = true; std::memcpy(entry.raw_remote_features, &features, 8); } if (page_number == 1) { entry.received_page_1 = true; Loading Loading @@ -612,6 +614,14 @@ bool L2CA_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, return true; } uint8_t* L2CA_ReadRemoteFeatures(const RawAddress& addr) { auto& entry = remote_feature_map_[addr]; if (!entry.received_page_0) { return nullptr; } return entry.raw_remote_features; } static void on_sco_disconnect(uint16_t handle, uint8_t reason) { GetGdShimHandler()->Post(base::BindOnce(base::IgnoreResult(&btm_sco_removed), handle, Loading system/main/shim/l2c_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -472,6 +472,8 @@ void L2CA_SwitchRoleToCentral(const RawAddress& addr); bool L2CA_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, uint16_t* manufacturer, uint16_t* lmp_sub_version); uint8_t* L2CA_ReadRemoteFeatures(const RawAddress& addr); void L2CA_DisconnectLink(const RawAddress& remote); uint16_t L2CA_GetNumLinks(); Loading system/stack/acl/btm_acl.cc +3 −0 Original line number Diff line number Diff line Loading @@ -1606,6 +1606,9 @@ bool BTM_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, * ******************************************************************************/ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) { if (bluetooth::shim::is_gd_l2cap_enabled()) { return bluetooth::shim::L2CA_ReadRemoteFeatures(addr); } tACL_CONN* p = internal_.btm_bda_to_acl(addr, BT_TRANSPORT_BR_EDR); if (p == NULL) { LOG_WARN("Unable to find active acl"); Loading system/stack/test/common/mock_main_shim_l2c_api.cc +4 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,10 @@ bool bluetooth::shim::L2CA_ReadRemoteVersion(const RawAddress& addr, mock_function_count_map[__func__]++; return false; } uint8_t* bluetooth::shim::L2CA_ReadRemoteFeatures(const RawAddress& remote) { mock_function_count_map[__func__]++; return 0; } void bluetooth::shim::L2CA_DisconnectLink(const RawAddress& remote) { mock_function_count_map[__func__]++; } Loading Loading
system/main/shim/l2c_api.cc +10 −0 Original line number Diff line number Diff line Loading @@ -334,6 +334,7 @@ struct RemoteFeature { uint8_t lmp_version = 0; uint16_t manufacturer_name = 0; uint16_t sub_version = 0; uint8_t raw_remote_features[8]; bool version_info_received = false; bool role_switch_supported = false; bool ssp_supported = false; Loading Loading @@ -375,6 +376,7 @@ struct LinkPropertyListenerShim if (page_number == 0) { entry.received_page_0 = true; if (features & 0x20) entry.role_switch_supported = true; std::memcpy(entry.raw_remote_features, &features, 8); } if (page_number == 1) { entry.received_page_1 = true; Loading Loading @@ -612,6 +614,14 @@ bool L2CA_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, return true; } uint8_t* L2CA_ReadRemoteFeatures(const RawAddress& addr) { auto& entry = remote_feature_map_[addr]; if (!entry.received_page_0) { return nullptr; } return entry.raw_remote_features; } static void on_sco_disconnect(uint16_t handle, uint8_t reason) { GetGdShimHandler()->Post(base::BindOnce(base::IgnoreResult(&btm_sco_removed), handle, Loading
system/main/shim/l2c_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -472,6 +472,8 @@ void L2CA_SwitchRoleToCentral(const RawAddress& addr); bool L2CA_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, uint16_t* manufacturer, uint16_t* lmp_sub_version); uint8_t* L2CA_ReadRemoteFeatures(const RawAddress& addr); void L2CA_DisconnectLink(const RawAddress& remote); uint16_t L2CA_GetNumLinks(); Loading
system/stack/acl/btm_acl.cc +3 −0 Original line number Diff line number Diff line Loading @@ -1606,6 +1606,9 @@ bool BTM_ReadRemoteVersion(const RawAddress& addr, uint8_t* lmp_version, * ******************************************************************************/ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) { if (bluetooth::shim::is_gd_l2cap_enabled()) { return bluetooth::shim::L2CA_ReadRemoteFeatures(addr); } tACL_CONN* p = internal_.btm_bda_to_acl(addr, BT_TRANSPORT_BR_EDR); if (p == NULL) { LOG_WARN("Unable to find active acl"); Loading
system/stack/test/common/mock_main_shim_l2c_api.cc +4 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,10 @@ bool bluetooth::shim::L2CA_ReadRemoteVersion(const RawAddress& addr, mock_function_count_map[__func__]++; return false; } uint8_t* bluetooth::shim::L2CA_ReadRemoteFeatures(const RawAddress& remote) { mock_function_count_map[__func__]++; return 0; } void bluetooth::shim::L2CA_DisconnectLink(const RawAddress& remote) { mock_function_count_map[__func__]++; } Loading