classic_cid_token_to_channel_map_.erase(cid_token);
}
+void remove_classic_dynamic_channel_helper(uint16_t psm);
+
struct ClassicDynamicChannelHelper {
ClassicDynamicChannelHelper(uint16_t psm, tL2CAP_APPL_INFO appl_info,
classic::DynamicChannelConfigurationOption config,
for (const auto& device : channels_) {
device.second->Close();
}
+ remove_classic_dynamic_channel_helper(psm_);
}
void on_channel_close(uint16_t cid_token,
bluetooth::hci::ErrorCode error_code) {
channel_enqueue_buffer_[cid_token] = nullptr;
+ channel_enqueue_buffer_.erase(cid_token);
channels_[cid_token]->GetQueueUpEnd()->UnregisterDequeue();
channels_.erase(cid_token);
do_in_main_thread(FROM_HERE, base::Bind(appl_info_.pL2CA_DisconnectInd_Cb,
std::unordered_map<uint16_t, std::unique_ptr<ClassicDynamicChannelHelper>>
classic_dynamic_channel_helper_map_;
+void remove_classic_dynamic_channel_helper(uint16_t psm) {
+ if (classic_dynamic_channel_helper_map_.count(psm) != 0 &&
+ classic_dynamic_channel_helper_map_[psm]->channels_.empty()) {
+ classic_dynamic_channel_helper_map_.erase(psm);
+ }
+}
+
// Helper: L2cap security enforcement shim
std::unordered_map<intptr_t,
return;
}
classic_dynamic_channel_helper_map_[psm]->Unregister();
- if (classic_dynamic_channel_helper_map_[psm]->channels_.empty()) {
- classic_dynamic_channel_helper_map_.erase(psm);
- }
}
/**
le_cid_token_to_channel_map_.erase(cid_token);
}
+void remove_le_dynamic_channel_helper(uint16_t psm);
+
struct LeDynamicChannelHelper {
LeDynamicChannelHelper(uint16_t psm, tL2CAP_APPL_INFO appl_info,
le::DynamicChannelConfigurationOption config,
for (const auto& device : channels_) {
device.second->Close();
}
+ remove_le_dynamic_channel_helper(psm_);
}
void on_channel_close(uint16_t cid_token,
bluetooth::hci::ErrorCode error_code) {
channel_enqueue_buffer_[cid_token] = nullptr;
+ channel_enqueue_buffer_.erase(cid_token);
channels_[cid_token]->GetQueueUpEnd()->UnregisterDequeue();
channels_.erase(cid_token);
do_in_main_thread(FROM_HERE, base::Bind(appl_info_.pL2CA_DisconnectInd_Cb,
std::unordered_map<uint16_t, std::unique_ptr<LeDynamicChannelHelper>>
le_dynamic_channel_helper_map_;
+void remove_le_dynamic_channel_helper(uint16_t psm) {
+ if (le_dynamic_channel_helper_map_.count(psm) != 0 &&
+ le_dynamic_channel_helper_map_[psm]->channels_.empty()) {
+ le_dynamic_channel_helper_map_.erase(psm);
+ }
+}
+
std::unordered_set<uint16_t> assigned_dynamic_le_psm_;
uint16_t next_assigned_dynamic_le_psm_ = 0x80;
} // namespace
return;
}
le_dynamic_channel_helper_map_[psm]->Unregister();
- if (le_dynamic_channel_helper_map_[psm]->channels_.empty()) {
- le_dynamic_channel_helper_map_.erase(psm);
- }
}
uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr,