Loading tools/rootcanal/model/controller/dual_mode_controller.cc +33 −4 Original line number Diff line number Diff line Loading @@ -301,6 +301,35 @@ void DualModeController::ReadBufferSize(CommandView command) { properties_.total_num_sco_data_packets)); } void DualModeController::ReadFailedContactCounter(CommandView command) { auto command_view = bluetooth::hci::ReadFailedContactCounterView::Create(command); ASSERT(command_view.IsValid()); uint16_t connection_handle = command_view.GetConnectionHandle(); uint16_t failed_contact_counter = 0; ErrorCode status = link_layer_controller_.HasAclConnection(connection_handle) ? ErrorCode::SUCCESS : ErrorCode::UNKNOWN_CONNECTION; send_event_(bluetooth::hci::ReadFailedContactCounterCompleteBuilder::Create( kNumCommandPackets, status, connection_handle, failed_contact_counter)); } void DualModeController::ResetFailedContactCounter(CommandView command) { auto command_view = bluetooth::hci::ReadFailedContactCounterView::Create(command); ASSERT(command_view.IsValid()); uint16_t connection_handle = command_view.GetConnectionHandle(); ErrorCode status = link_layer_controller_.HasAclConnection(connection_handle) ? ErrorCode::SUCCESS : ErrorCode::UNKNOWN_CONNECTION; send_event_(bluetooth::hci::ResetFailedContactCounterCompleteBuilder::Create( kNumCommandPackets, status, connection_handle)); } void DualModeController::ReadRssi(CommandView command) { auto command_view = bluetooth::hci::ReadRssiView::Create(command); ASSERT(command_view.IsValid()); Loading Loading @@ -3510,10 +3539,10 @@ const std::unordered_map<OpCode, DualModeController::CommandHandler> //&DualModeController::ReadLocalSupportedControllerDelay}, // STATUS_PARAMETERS //{OpCode::READ_FAILED_CONTACT_COUNTER, //&DualModeController::ReadFailedContactCounter}, //{OpCode::RESET_FAILED_CONTACT_COUNTER, //&DualModeController::ResetFailedContactCounter}, {OpCode::READ_FAILED_CONTACT_COUNTER, &DualModeController::ReadFailedContactCounter}, {OpCode::RESET_FAILED_CONTACT_COUNTER, &DualModeController::ResetFailedContactCounter}, //{OpCode::READ_LINK_QUALITY, &DualModeController::ReadLinkQuality}, {OpCode::READ_RSSI, &DualModeController::ReadRssi}, //{OpCode::READ_AFH_CHANNEL_MAP, Loading tools/rootcanal/model/controller/dual_mode_controller.h +4 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,10 @@ class DualModeController : public Device { // Status Parameters Commands // Bluetooth Core Specification Version 4.2 Volume 2 Part E 7.5 // 7.5.1 - 7.5.2 void ReadFailedContactCounter(CommandView command); void ResetFailedContactCounter(CommandView command); // 7.5.4 void ReadRssi(CommandView command); Loading tools/rootcanal/model/controller/link_layer_controller.cc +4 −0 Original line number Diff line number Diff line Loading @@ -5875,6 +5875,10 @@ bool LinkLayerController::HasAclConnection() { return !connections_.GetAclHandles().empty(); } bool LinkLayerController::HasAclConnection(uint16_t connection_handle) { return connections_.HasHandle(connection_handle); } void LinkLayerController::LeReadIsoTxSync(uint16_t /* handle */) {} void LinkLayerController::LeSetCigParameters( Loading tools/rootcanal/model/controller/link_layer_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -345,7 +345,10 @@ class LinkLayerController { uint8_t retransmission_effort, uint16_t packet_types); ErrorCode RejectSynchronousConnection(Address bd_addr, uint16_t reason); // Returns true if any ACL connection exists. bool HasAclConnection(); // Returns true if the specified ACL connection handle is valid. bool HasAclConnection(uint16_t connection_handle); void HandleIso(bluetooth::hci::IsoView iso); Loading Loading
tools/rootcanal/model/controller/dual_mode_controller.cc +33 −4 Original line number Diff line number Diff line Loading @@ -301,6 +301,35 @@ void DualModeController::ReadBufferSize(CommandView command) { properties_.total_num_sco_data_packets)); } void DualModeController::ReadFailedContactCounter(CommandView command) { auto command_view = bluetooth::hci::ReadFailedContactCounterView::Create(command); ASSERT(command_view.IsValid()); uint16_t connection_handle = command_view.GetConnectionHandle(); uint16_t failed_contact_counter = 0; ErrorCode status = link_layer_controller_.HasAclConnection(connection_handle) ? ErrorCode::SUCCESS : ErrorCode::UNKNOWN_CONNECTION; send_event_(bluetooth::hci::ReadFailedContactCounterCompleteBuilder::Create( kNumCommandPackets, status, connection_handle, failed_contact_counter)); } void DualModeController::ResetFailedContactCounter(CommandView command) { auto command_view = bluetooth::hci::ReadFailedContactCounterView::Create(command); ASSERT(command_view.IsValid()); uint16_t connection_handle = command_view.GetConnectionHandle(); ErrorCode status = link_layer_controller_.HasAclConnection(connection_handle) ? ErrorCode::SUCCESS : ErrorCode::UNKNOWN_CONNECTION; send_event_(bluetooth::hci::ResetFailedContactCounterCompleteBuilder::Create( kNumCommandPackets, status, connection_handle)); } void DualModeController::ReadRssi(CommandView command) { auto command_view = bluetooth::hci::ReadRssiView::Create(command); ASSERT(command_view.IsValid()); Loading Loading @@ -3510,10 +3539,10 @@ const std::unordered_map<OpCode, DualModeController::CommandHandler> //&DualModeController::ReadLocalSupportedControllerDelay}, // STATUS_PARAMETERS //{OpCode::READ_FAILED_CONTACT_COUNTER, //&DualModeController::ReadFailedContactCounter}, //{OpCode::RESET_FAILED_CONTACT_COUNTER, //&DualModeController::ResetFailedContactCounter}, {OpCode::READ_FAILED_CONTACT_COUNTER, &DualModeController::ReadFailedContactCounter}, {OpCode::RESET_FAILED_CONTACT_COUNTER, &DualModeController::ResetFailedContactCounter}, //{OpCode::READ_LINK_QUALITY, &DualModeController::ReadLinkQuality}, {OpCode::READ_RSSI, &DualModeController::ReadRssi}, //{OpCode::READ_AFH_CHANNEL_MAP, Loading
tools/rootcanal/model/controller/dual_mode_controller.h +4 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,10 @@ class DualModeController : public Device { // Status Parameters Commands // Bluetooth Core Specification Version 4.2 Volume 2 Part E 7.5 // 7.5.1 - 7.5.2 void ReadFailedContactCounter(CommandView command); void ResetFailedContactCounter(CommandView command); // 7.5.4 void ReadRssi(CommandView command); Loading
tools/rootcanal/model/controller/link_layer_controller.cc +4 −0 Original line number Diff line number Diff line Loading @@ -5875,6 +5875,10 @@ bool LinkLayerController::HasAclConnection() { return !connections_.GetAclHandles().empty(); } bool LinkLayerController::HasAclConnection(uint16_t connection_handle) { return connections_.HasHandle(connection_handle); } void LinkLayerController::LeReadIsoTxSync(uint16_t /* handle */) {} void LinkLayerController::LeSetCigParameters( Loading
tools/rootcanal/model/controller/link_layer_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -345,7 +345,10 @@ class LinkLayerController { uint8_t retransmission_effort, uint16_t packet_types); ErrorCode RejectSynchronousConnection(Address bd_addr, uint16_t reason); // Returns true if any ACL connection exists. bool HasAclConnection(); // Returns true if the specified ACL connection handle is valid. bool HasAclConnection(uint16_t connection_handle); void HandleIso(bluetooth::hci::IsoView iso); Loading