Loading tools/rootcanal/model/controller/dual_mode_controller.cc +12 −7 Original line number Diff line number Diff line Loading @@ -1676,13 +1676,18 @@ void DualModeController::LeSetEventMask(CommandView command) { void DualModeController::LeSetHostFeature(CommandView command) { auto command_view = gd_hci::LeSetHostFeatureView::Create(command); ASSERT(command_view.IsValid()); // TODO: if the controller has active connections, return COMMAND_DISALLOED ErrorCode error_code = properties_.SetLeHostFeature( ErrorCode error_code = ErrorCode::SUCCESS; if (link_layer_controller_.HasAclConnection()) { error_code = ErrorCode::COMMAND_DISALLOWED; } else { bool bit_was_set = properties_.SetLeHostFeature( static_cast<uint8_t>(command_view.GetBitNumber()), static_cast<uint8_t>(command_view.GetBitValue())) ? ErrorCode::SUCCESS : ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; static_cast<uint8_t>(command_view.GetBitValue())); if (!bit_was_set) { error_code = ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; } } send_event_(bluetooth::hci::LeSetHostFeatureCompleteBuilder::Create( kNumCommandPackets, error_code)); } Loading tools/rootcanal/model/controller/link_layer_controller.cc +4 −0 Original line number Diff line number Diff line Loading @@ -3396,6 +3396,10 @@ ErrorCode LinkLayerController::LeResolvingListAddDevice( return ErrorCode::SUCCESS; } bool LinkLayerController::HasAclConnection() { return (connections_.GetAclHandles().size() > 0); } void LinkLayerController::LeSetPrivacyMode(uint8_t address_type, Address addr, uint8_t mode) { // set mode for addr Loading tools/rootcanal/model/controller/link_layer_controller.h +2 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,8 @@ class LinkLayerController { uint8_t retransmission_effort, uint16_t packet_types); ErrorCode RejectSynchronousConnection(Address bd_addr, uint16_t reason); bool HasAclConnection(); void HandleIso(bluetooth::hci::IsoView iso); protected: Loading Loading
tools/rootcanal/model/controller/dual_mode_controller.cc +12 −7 Original line number Diff line number Diff line Loading @@ -1676,13 +1676,18 @@ void DualModeController::LeSetEventMask(CommandView command) { void DualModeController::LeSetHostFeature(CommandView command) { auto command_view = gd_hci::LeSetHostFeatureView::Create(command); ASSERT(command_view.IsValid()); // TODO: if the controller has active connections, return COMMAND_DISALLOED ErrorCode error_code = properties_.SetLeHostFeature( ErrorCode error_code = ErrorCode::SUCCESS; if (link_layer_controller_.HasAclConnection()) { error_code = ErrorCode::COMMAND_DISALLOWED; } else { bool bit_was_set = properties_.SetLeHostFeature( static_cast<uint8_t>(command_view.GetBitNumber()), static_cast<uint8_t>(command_view.GetBitValue())) ? ErrorCode::SUCCESS : ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; static_cast<uint8_t>(command_view.GetBitValue())); if (!bit_was_set) { error_code = ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; } } send_event_(bluetooth::hci::LeSetHostFeatureCompleteBuilder::Create( kNumCommandPackets, error_code)); } Loading
tools/rootcanal/model/controller/link_layer_controller.cc +4 −0 Original line number Diff line number Diff line Loading @@ -3396,6 +3396,10 @@ ErrorCode LinkLayerController::LeResolvingListAddDevice( return ErrorCode::SUCCESS; } bool LinkLayerController::HasAclConnection() { return (connections_.GetAclHandles().size() > 0); } void LinkLayerController::LeSetPrivacyMode(uint8_t address_type, Address addr, uint8_t mode) { // set mode for addr Loading
tools/rootcanal/model/controller/link_layer_controller.h +2 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,8 @@ class LinkLayerController { uint8_t retransmission_effort, uint16_t packet_types); ErrorCode RejectSynchronousConnection(Address bd_addr, uint16_t reason); bool HasAclConnection(); void HandleIso(bluetooth::hci::IsoView iso); protected: Loading