Loading system/gd/hci/hci_packets.pdl +12 −4 Original line number Diff line number Diff line Loading @@ -3282,8 +3282,7 @@ packet InquiryComplete : EventPacket (event_code = INQUIRY_COMPLETE){ status : ErrorCode, } packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ num_responses : 8, struct InquiryResult { bd_addr : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, Loading @@ -3293,6 +3292,11 @@ packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ _reserved_ : 1, } packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ _count_(inquiry_results) : 8, inquiry_results : InquiryResult[], } enum LinkType : 8 { SCO = 0x00, ACL = 0x01, Loading Loading @@ -3513,8 +3517,7 @@ packet FlowSpecificationComplete : EventPacket (event_code = FLOW_SPECIFICATION_ access_latency : 32, // Octets/s } packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSSI){ num_responses : 8, struct InquiryResultWithRssi { address : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, Loading @@ -3524,6 +3527,11 @@ packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSS rssi : 8, } packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSSI){ _count_(inquiry_results) : 8, inquiry_results : InquiryResultWithRssi[], } packet ReadRemoteExtendedFeaturesComplete : EventPacket (event_code = READ_REMOTE_EXTENDED_FEATURES_COMPLETE){ status : ErrorCode, connection_handle : 12, Loading system/gd/neighbor/inquiry.cc +2 −8 Original line number Diff line number Diff line Loading @@ -204,20 +204,14 @@ void neighbor::InquiryModule::impl::OnEvent(hci::EventPacketView view) { case hci::EventCode::INQUIRY_RESULT: { auto packet = hci::InquiryResultView::Create(view); ASSERT(packet.IsValid()); LOG_DEBUG("Inquiry result size:%zd num_responses:%d addr:%s repetition_mode:%s cod:%s clock_offset:%d", packet.size(), packet.GetNumResponses(), packet.GetBdAddr().ToString().c_str(), hci::PageScanRepetitionModeText(packet.GetPageScanRepetitionMode()).c_str(), packet.GetClassOfDevice().ToString().c_str(), packet.GetClockOffset()); LOG_DEBUG("Inquiry result size:%zd num_responses:%zu", packet.size(), packet.GetInquiryResults().size()); inquiry_callbacks_.result(packet); } break; case hci::EventCode::INQUIRY_RESULT_WITH_RSSI: { auto packet = hci::InquiryResultWithRssiView::Create(view); ASSERT(packet.IsValid()); LOG_DEBUG("Inquiry result with rssi num_responses:%d addr:%s repetition_mode:%s cod:%s clock_offset:%d", packet.GetNumResponses(), packet.GetAddress().ToString().c_str(), hci::PageScanRepetitionModeText(packet.GetPageScanRepetitionMode()).c_str(), packet.GetClassOfDevice().ToString().c_str(), packet.GetClockOffset()); LOG_DEBUG("Inquiry result with rssi num_responses:%zu", packet.GetInquiryResults().size()); inquiry_callbacks_.result_with_rssi(packet); } break; Loading system/gd/neighbor/inquiry_test.cc +2 −9 Original line number Diff line number Diff line Loading @@ -459,15 +459,8 @@ TEST_F(InquiryTest, InjectInquiryResult) { test_hci_layer_->Synchronize([this] { inquiry_module_->StartGeneralInquiry(128, 100); }, hci::OpCode::INQUIRY); WaitForInquiryResult([this] { uint8_t num_responses = 1; hci::Address bd_addr; hci::Address::FromString("11:22:33:44:55:66", bd_addr); hci::PageScanRepetitionMode page_scan_repetition_mode = hci::PageScanRepetitionMode::R1; hci::ClassOfDevice class_of_device; hci::ClassOfDevice::FromString("00:00:00", class_of_device); uint16_t clock_offset = 0x1234; auto packet = hci::InquiryResultBuilder::Create(num_responses, bd_addr, page_scan_repetition_mode, class_of_device, clock_offset); const std::vector<hci::InquiryResult> inquiry_results; auto packet = hci::InquiryResultBuilder::Create(inquiry_results); test_hci_layer_->InjectInquiryResult(std::move(packet)); }); test_hci_layer_->Synchronize([this] { inquiry_module_->StopInquiry(); }, hci::OpCode::INQUIRY_CANCEL); Loading system/gd/security/facade.cc +7 −2 Original line number Diff line number Diff line Loading @@ -14,11 +14,13 @@ * limitations under the License. */ #include "security/facade.h" #include "hci/hci_layer.h" #include "l2cap/classic/l2cap_classic_module.h" #include "l2cap/le/l2cap_le_module.h" #include "os/handler.h" #include "security/facade.grpc.pb.h" #include "security/security_manager_listener.h" #include "security/security_module.h" namespace bluetooth { Loading Loading @@ -61,10 +63,13 @@ class SecurityModuleFacadeService : public SecurityModuleFacade::Service, public return ::grpc::Status::OK; } void OnDisplayYesNoDialogWithValue(const bluetooth::hci::AddressWithType& address, uint32_t numeric_value) {} void OnDisplayYesNoDialog(const bluetooth::hci::AddressWithType& address) {} void OnDisplayPasskeyDialog(const bluetooth::hci::AddressWithType& address, uint32_t passkey) {} void OnDisplayPasskeyInputDialog(const bluetooth::hci::AddressWithType& address){}; void OnDisplayCancelDialog(const bluetooth::hci::AddressWithType& address) {} void OnDeviceBonded(hci::AddressWithType device) {} void OnDeviceUnbonded(hci::AddressWithType device) {} void OnDeviceBondFailed(hci::AddressWithType device) {} private: Loading system/gd/security/internal/security_manager_impl.cc +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ void SecurityManagerImpl::DispatchPairingHandler(std::shared_ptr<security::recor case hci::AddressType::PUBLIC_DEVICE_ADDRESS: pairing_handler = std::make_shared<security::pairing::ClassicPairingHandler>( l2cap_classic_module_->GetFixedChannelManager(), security_manager_channel_, record, security_handler_, std::move(callback)); std::move(callback), listeners_); break; default: ASSERT_LOG(false, "Pairing type %hhu not implemented!", record->GetPseudoAddress().GetAddressType()); Loading Loading
system/gd/hci/hci_packets.pdl +12 −4 Original line number Diff line number Diff line Loading @@ -3282,8 +3282,7 @@ packet InquiryComplete : EventPacket (event_code = INQUIRY_COMPLETE){ status : ErrorCode, } packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ num_responses : 8, struct InquiryResult { bd_addr : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, Loading @@ -3293,6 +3292,11 @@ packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ _reserved_ : 1, } packet InquiryResult : EventPacket (event_code = INQUIRY_RESULT){ _count_(inquiry_results) : 8, inquiry_results : InquiryResult[], } enum LinkType : 8 { SCO = 0x00, ACL = 0x01, Loading Loading @@ -3513,8 +3517,7 @@ packet FlowSpecificationComplete : EventPacket (event_code = FLOW_SPECIFICATION_ access_latency : 32, // Octets/s } packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSSI){ num_responses : 8, struct InquiryResultWithRssi { address : Address, page_scan_repetition_mode : PageScanRepetitionMode, _reserved_ : 8, Loading @@ -3524,6 +3527,11 @@ packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSS rssi : 8, } packet InquiryResultWithRssi : EventPacket (event_code = INQUIRY_RESULT_WITH_RSSI){ _count_(inquiry_results) : 8, inquiry_results : InquiryResultWithRssi[], } packet ReadRemoteExtendedFeaturesComplete : EventPacket (event_code = READ_REMOTE_EXTENDED_FEATURES_COMPLETE){ status : ErrorCode, connection_handle : 12, Loading
system/gd/neighbor/inquiry.cc +2 −8 Original line number Diff line number Diff line Loading @@ -204,20 +204,14 @@ void neighbor::InquiryModule::impl::OnEvent(hci::EventPacketView view) { case hci::EventCode::INQUIRY_RESULT: { auto packet = hci::InquiryResultView::Create(view); ASSERT(packet.IsValid()); LOG_DEBUG("Inquiry result size:%zd num_responses:%d addr:%s repetition_mode:%s cod:%s clock_offset:%d", packet.size(), packet.GetNumResponses(), packet.GetBdAddr().ToString().c_str(), hci::PageScanRepetitionModeText(packet.GetPageScanRepetitionMode()).c_str(), packet.GetClassOfDevice().ToString().c_str(), packet.GetClockOffset()); LOG_DEBUG("Inquiry result size:%zd num_responses:%zu", packet.size(), packet.GetInquiryResults().size()); inquiry_callbacks_.result(packet); } break; case hci::EventCode::INQUIRY_RESULT_WITH_RSSI: { auto packet = hci::InquiryResultWithRssiView::Create(view); ASSERT(packet.IsValid()); LOG_DEBUG("Inquiry result with rssi num_responses:%d addr:%s repetition_mode:%s cod:%s clock_offset:%d", packet.GetNumResponses(), packet.GetAddress().ToString().c_str(), hci::PageScanRepetitionModeText(packet.GetPageScanRepetitionMode()).c_str(), packet.GetClassOfDevice().ToString().c_str(), packet.GetClockOffset()); LOG_DEBUG("Inquiry result with rssi num_responses:%zu", packet.GetInquiryResults().size()); inquiry_callbacks_.result_with_rssi(packet); } break; Loading
system/gd/neighbor/inquiry_test.cc +2 −9 Original line number Diff line number Diff line Loading @@ -459,15 +459,8 @@ TEST_F(InquiryTest, InjectInquiryResult) { test_hci_layer_->Synchronize([this] { inquiry_module_->StartGeneralInquiry(128, 100); }, hci::OpCode::INQUIRY); WaitForInquiryResult([this] { uint8_t num_responses = 1; hci::Address bd_addr; hci::Address::FromString("11:22:33:44:55:66", bd_addr); hci::PageScanRepetitionMode page_scan_repetition_mode = hci::PageScanRepetitionMode::R1; hci::ClassOfDevice class_of_device; hci::ClassOfDevice::FromString("00:00:00", class_of_device); uint16_t clock_offset = 0x1234; auto packet = hci::InquiryResultBuilder::Create(num_responses, bd_addr, page_scan_repetition_mode, class_of_device, clock_offset); const std::vector<hci::InquiryResult> inquiry_results; auto packet = hci::InquiryResultBuilder::Create(inquiry_results); test_hci_layer_->InjectInquiryResult(std::move(packet)); }); test_hci_layer_->Synchronize([this] { inquiry_module_->StopInquiry(); }, hci::OpCode::INQUIRY_CANCEL); Loading
system/gd/security/facade.cc +7 −2 Original line number Diff line number Diff line Loading @@ -14,11 +14,13 @@ * limitations under the License. */ #include "security/facade.h" #include "hci/hci_layer.h" #include "l2cap/classic/l2cap_classic_module.h" #include "l2cap/le/l2cap_le_module.h" #include "os/handler.h" #include "security/facade.grpc.pb.h" #include "security/security_manager_listener.h" #include "security/security_module.h" namespace bluetooth { Loading Loading @@ -61,10 +63,13 @@ class SecurityModuleFacadeService : public SecurityModuleFacade::Service, public return ::grpc::Status::OK; } void OnDisplayYesNoDialogWithValue(const bluetooth::hci::AddressWithType& address, uint32_t numeric_value) {} void OnDisplayYesNoDialog(const bluetooth::hci::AddressWithType& address) {} void OnDisplayPasskeyDialog(const bluetooth::hci::AddressWithType& address, uint32_t passkey) {} void OnDisplayPasskeyInputDialog(const bluetooth::hci::AddressWithType& address){}; void OnDisplayCancelDialog(const bluetooth::hci::AddressWithType& address) {} void OnDeviceBonded(hci::AddressWithType device) {} void OnDeviceUnbonded(hci::AddressWithType device) {} void OnDeviceBondFailed(hci::AddressWithType device) {} private: Loading
system/gd/security/internal/security_manager_impl.cc +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ void SecurityManagerImpl::DispatchPairingHandler(std::shared_ptr<security::recor case hci::AddressType::PUBLIC_DEVICE_ADDRESS: pairing_handler = std::make_shared<security::pairing::ClassicPairingHandler>( l2cap_classic_module_->GetFixedChannelManager(), security_manager_channel_, record, security_handler_, std::move(callback)); std::move(callback), listeners_); break; default: ASSERT_LOG(false, "Pairing type %hhu not implemented!", record->GetPseudoAddress().GetAddressType()); Loading