Loading tools/rootcanal/model/controller/dual_mode_controller.cc +2 −1 Original line number Diff line number Diff line Loading @@ -1494,7 +1494,7 @@ void DualModeController::ReadPageTimeout(CommandView command) { auto command_view = gd_hci::ReadPageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t page_timeout = 0x2000; uint16_t page_timeout = link_layer_controller_.GetPageTimeout(); send_event_(bluetooth::hci::ReadPageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_timeout)); } Loading @@ -1503,6 +1503,7 @@ void DualModeController::WritePageTimeout(CommandView command) { auto command_view = gd_hci::WritePageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); link_layer_controller_.SetPageTimeout(command_view.GetPageTimeout()); send_event_(bluetooth::hci::WritePageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS)); } Loading tools/rootcanal/model/controller/link_layer_controller.cc +16 −0 Original line number Diff line number Diff line Loading @@ -2673,6 +2673,7 @@ void LinkLayerController::IncomingPageResponsePacket( LOG_WARN("No free handles"); return; } CancelScheduledTask(page_timeout_task_id_); #ifdef ROOTCANAL_LMP ASSERT(link_manager_add_link( lm_.get(), reinterpret_cast<const uint8_t(*)[6]>(peer.data()))); Loading Loading @@ -3358,6 +3359,14 @@ ErrorCode LinkLayerController::CreateConnection(const Address& addr, uint16_t, return ErrorCode::CONTROLLER_BUSY; } page_timeout_task_id_ = ScheduleTask( duration_cast<milliseconds>(page_timeout_ * microseconds(625)), [this, addr] { send_event_(bluetooth::hci::ConnectionCompleteBuilder::Create( ErrorCode::PAGE_TIMEOUT, 0xeff, addr, bluetooth::hci::LinkType::ACL, bluetooth::hci::Enable::DISABLED)); }); SendLinkLayerPacket(model::packets::PageBuilder::Create( GetAddress(), addr, class_of_device_, allow_role_switch)); Loading @@ -3368,6 +3377,7 @@ ErrorCode LinkLayerController::CreateConnectionCancel(const Address& addr) { if (!connections_.CancelPendingConnection(addr)) { return ErrorCode::UNKNOWN_CONNECTION; } CancelScheduledTask(page_timeout_task_id_); return ErrorCode::SUCCESS; } Loading Loading @@ -4224,6 +4234,12 @@ void LinkLayerController::SetPageScanEnable(bool enable) { page_scan_enable_ = enable; } uint16_t LinkLayerController::GetPageTimeout() { return page_timeout_; } void LinkLayerController::SetPageTimeout(uint16_t page_timeout) { page_timeout_ = page_timeout; } ErrorCode LinkLayerController::AddScoConnection(uint16_t connection_handle, uint16_t packet_type) { if (!connections_.HasHandle(connection_handle)) { Loading tools/rootcanal/model/controller/link_layer_controller.h +4 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,8 @@ class LinkLayerController { void SetInquiryScanEnable(bool enable); void SetPageScanEnable(bool enable); uint16_t GetPageTimeout(); void SetPageTimeout(uint16_t page_timeout); ErrorCode ChangeConnectionPacketType(uint16_t handle, uint16_t types); ErrorCode ChangeConnectionLinkKey(uint16_t handle); Loading Loading @@ -840,6 +842,8 @@ class LinkLayerController { SecurityManager security_manager_{10}; #endif /* ROOTCANAL_LMP */ AsyncTaskId page_timeout_task_id_ = kInvalidTaskId; std::chrono::steady_clock::time_point last_inquiry_; model::packets::InquiryType inquiry_mode_{ model::packets::InquiryType::STANDARD}; Loading Loading
tools/rootcanal/model/controller/dual_mode_controller.cc +2 −1 Original line number Diff line number Diff line Loading @@ -1494,7 +1494,7 @@ void DualModeController::ReadPageTimeout(CommandView command) { auto command_view = gd_hci::ReadPageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t page_timeout = 0x2000; uint16_t page_timeout = link_layer_controller_.GetPageTimeout(); send_event_(bluetooth::hci::ReadPageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_timeout)); } Loading @@ -1503,6 +1503,7 @@ void DualModeController::WritePageTimeout(CommandView command) { auto command_view = gd_hci::WritePageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); link_layer_controller_.SetPageTimeout(command_view.GetPageTimeout()); send_event_(bluetooth::hci::WritePageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS)); } Loading
tools/rootcanal/model/controller/link_layer_controller.cc +16 −0 Original line number Diff line number Diff line Loading @@ -2673,6 +2673,7 @@ void LinkLayerController::IncomingPageResponsePacket( LOG_WARN("No free handles"); return; } CancelScheduledTask(page_timeout_task_id_); #ifdef ROOTCANAL_LMP ASSERT(link_manager_add_link( lm_.get(), reinterpret_cast<const uint8_t(*)[6]>(peer.data()))); Loading Loading @@ -3358,6 +3359,14 @@ ErrorCode LinkLayerController::CreateConnection(const Address& addr, uint16_t, return ErrorCode::CONTROLLER_BUSY; } page_timeout_task_id_ = ScheduleTask( duration_cast<milliseconds>(page_timeout_ * microseconds(625)), [this, addr] { send_event_(bluetooth::hci::ConnectionCompleteBuilder::Create( ErrorCode::PAGE_TIMEOUT, 0xeff, addr, bluetooth::hci::LinkType::ACL, bluetooth::hci::Enable::DISABLED)); }); SendLinkLayerPacket(model::packets::PageBuilder::Create( GetAddress(), addr, class_of_device_, allow_role_switch)); Loading @@ -3368,6 +3377,7 @@ ErrorCode LinkLayerController::CreateConnectionCancel(const Address& addr) { if (!connections_.CancelPendingConnection(addr)) { return ErrorCode::UNKNOWN_CONNECTION; } CancelScheduledTask(page_timeout_task_id_); return ErrorCode::SUCCESS; } Loading Loading @@ -4224,6 +4234,12 @@ void LinkLayerController::SetPageScanEnable(bool enable) { page_scan_enable_ = enable; } uint16_t LinkLayerController::GetPageTimeout() { return page_timeout_; } void LinkLayerController::SetPageTimeout(uint16_t page_timeout) { page_timeout_ = page_timeout; } ErrorCode LinkLayerController::AddScoConnection(uint16_t connection_handle, uint16_t packet_type) { if (!connections_.HasHandle(connection_handle)) { Loading
tools/rootcanal/model/controller/link_layer_controller.h +4 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,8 @@ class LinkLayerController { void SetInquiryScanEnable(bool enable); void SetPageScanEnable(bool enable); uint16_t GetPageTimeout(); void SetPageTimeout(uint16_t page_timeout); ErrorCode ChangeConnectionPacketType(uint16_t handle, uint16_t types); ErrorCode ChangeConnectionLinkKey(uint16_t handle); Loading Loading @@ -840,6 +842,8 @@ class LinkLayerController { SecurityManager security_manager_{10}; #endif /* ROOTCANAL_LMP */ AsyncTaskId page_timeout_task_id_ = kInvalidTaskId; std::chrono::steady_clock::time_point last_inquiry_; model::packets::InquiryType inquiry_mode_{ model::packets::InquiryType::STANDARD}; Loading