Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +126 −0 Original line number Original line Diff line number Diff line Loading @@ -119,14 +119,19 @@ DualModeController::DualModeController(const std::string& properties_filename, u UserConfirmationRequestNegativeReply); UserConfirmationRequestNegativeReply); SET_HANDLER(OpCode::IO_CAPABILITY_REQUEST_NEGATIVE_REPLY, SET_HANDLER(OpCode::IO_CAPABILITY_REQUEST_NEGATIVE_REPLY, IoCapabilityRequestNegativeReply); IoCapabilityRequestNegativeReply); SET_HANDLER(OpCode::READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL, ReadInquiryResponseTransmitPowerLevel); SET_HANDLER(OpCode::WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode); SET_HANDLER(OpCode::WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode); SET_HANDLER(OpCode::WRITE_LE_HOST_SUPPORT, WriteLeHostSupport); SET_HANDLER(OpCode::WRITE_LE_HOST_SUPPORT, WriteLeHostSupport); SET_HANDLER(OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, SET_HANDLER(OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, WriteSecureConnectionsHostSupport); WriteSecureConnectionsHostSupport); SET_HANDLER(OpCode::SET_EVENT_MASK, SetEventMask); SET_HANDLER(OpCode::SET_EVENT_MASK, SetEventMask); SET_HANDLER(OpCode::READ_INQUIRY_MODE, ReadInquiryMode); SET_HANDLER(OpCode::WRITE_INQUIRY_MODE, WriteInquiryMode); SET_HANDLER(OpCode::WRITE_INQUIRY_MODE, WriteInquiryMode); SET_HANDLER(OpCode::READ_PAGE_SCAN_TYPE, ReadPageScanType); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_TYPE, WritePageScanType); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_TYPE, WritePageScanType); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_TYPE, WriteInquiryScanType); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_TYPE, WriteInquiryScanType); SET_HANDLER(OpCode::READ_INQUIRY_SCAN_TYPE, ReadInquiryScanType); SET_HANDLER(OpCode::AUTHENTICATION_REQUESTED, AuthenticationRequested); SET_HANDLER(OpCode::AUTHENTICATION_REQUESTED, AuthenticationRequested); SET_HANDLER(OpCode::SET_CONNECTION_ENCRYPTION, SetConnectionEncryption); SET_HANDLER(OpCode::SET_CONNECTION_ENCRYPTION, SetConnectionEncryption); SET_HANDLER(OpCode::CHANGE_CONNECTION_LINK_KEY, ChangeConnectionLinkKey); SET_HANDLER(OpCode::CHANGE_CONNECTION_LINK_KEY, ChangeConnectionLinkKey); Loading @@ -134,6 +139,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_HANDLER(OpCode::WRITE_AUTHENTICATION_ENABLE, WriteAuthenticationEnable); SET_HANDLER(OpCode::WRITE_AUTHENTICATION_ENABLE, WriteAuthenticationEnable); SET_HANDLER(OpCode::READ_AUTHENTICATION_ENABLE, ReadAuthenticationEnable); SET_HANDLER(OpCode::READ_AUTHENTICATION_ENABLE, ReadAuthenticationEnable); SET_HANDLER(OpCode::WRITE_CLASS_OF_DEVICE, WriteClassOfDevice); SET_HANDLER(OpCode::WRITE_CLASS_OF_DEVICE, WriteClassOfDevice); SET_HANDLER(OpCode::READ_PAGE_TIMEOUT, ReadPageTimeout); SET_HANDLER(OpCode::WRITE_PAGE_TIMEOUT, WritePageTimeout); SET_HANDLER(OpCode::WRITE_PAGE_TIMEOUT, WritePageTimeout); SET_HANDLER(OpCode::WRITE_LINK_SUPERVISION_TIMEOUT, SET_HANDLER(OpCode::WRITE_LINK_SUPERVISION_TIMEOUT, WriteLinkSupervisionTimeout); WriteLinkSupervisionTimeout); Loading @@ -153,8 +159,14 @@ DualModeController::DualModeController(const std::string& properties_filename, u WriteExtendedInquiryResponse); WriteExtendedInquiryResponse); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, RefreshEncryptionKey); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, RefreshEncryptionKey); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, WriteVoiceSetting); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, WriteVoiceSetting); SET_HANDLER(OpCode::READ_NUMBER_OF_SUPPORTED_IAC, ReadNumberOfSupportedIac); SET_HANDLER(OpCode::READ_CURRENT_IAC_LAP, ReadCurrentIacLap); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, WriteCurrentIacLap); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, WriteCurrentIacLap); SET_HANDLER(OpCode::READ_PAGE_SCAN_ACTIVITY, ReadPageScanActivity); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_ACTIVITY, WritePageScanActivity); SET_HANDLER(OpCode::READ_INQUIRY_SCAN_ACTIVITY, ReadInquiryScanActivity); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, WriteInquiryScanActivity); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, WriteInquiryScanActivity); SET_HANDLER(OpCode::READ_SCAN_ENABLE, ReadScanEnable); SET_HANDLER(OpCode::WRITE_SCAN_ENABLE, WriteScanEnable); SET_HANDLER(OpCode::WRITE_SCAN_ENABLE, WriteScanEnable); SET_HANDLER(OpCode::SET_EVENT_FILTER, SetEventFilter); SET_HANDLER(OpCode::SET_EVENT_FILTER, SetEventFilter); SET_HANDLER(OpCode::INQUIRY, Inquiry); SET_HANDLER(OpCode::INQUIRY, Inquiry); Loading Loading @@ -681,6 +693,19 @@ void DualModeController::IoCapabilityRequestNegativeReply( send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryResponseTransmitPowerLevel( CommandPacketView command) { auto command_view = gd_hci::ReadInquiryResponseTransmitPowerLevelView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint8_t tx_power = 20; // maximum auto packet = bluetooth::hci::ReadInquiryResponseTransmitPowerLevelCompleteBuilder:: Create(kNumCommandPackets, ErrorCode::SUCCESS, tx_power); send_event_(std::move(packet)); } void DualModeController::WriteSimplePairingMode(CommandPacketView command) { void DualModeController::WriteSimplePairingMode(CommandPacketView command) { auto command_view = gd_hci::WriteSimplePairingModeView::Create( auto command_view = gd_hci::WriteSimplePairingModeView::Create( gd_hci::SecurityCommandView::Create(command)); gd_hci::SecurityCommandView::Create(command)); Loading Loading @@ -736,6 +761,16 @@ void DualModeController::SetEventMask(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryMode(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryModeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::InquiryMode inquiry_mode = gd_hci::InquiryMode::STANDARD; auto packet = bluetooth::hci::ReadInquiryModeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, inquiry_mode); send_event_(std::move(packet)); } void DualModeController::WriteInquiryMode(CommandPacketView command) { void DualModeController::WriteInquiryMode(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryModeView::Create( auto command_view = gd_hci::WriteInquiryModeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -747,6 +782,16 @@ void DualModeController::WriteInquiryMode(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageScanType(CommandPacketView command) { auto command_view = gd_hci::ReadPageScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::PageScanType page_scan_type = gd_hci::PageScanType::STANDARD; auto packet = bluetooth::hci::ReadPageScanTypeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_scan_type); send_event_(std::move(packet)); } void DualModeController::WritePageScanType(CommandPacketView command) { void DualModeController::WritePageScanType(CommandPacketView command) { auto command_view = gd_hci::WritePageScanTypeView::Create( auto command_view = gd_hci::WritePageScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -756,6 +801,16 @@ void DualModeController::WritePageScanType(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryScanType(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::InquiryScanType inquiry_scan_type = gd_hci::InquiryScanType::STANDARD; auto packet = bluetooth::hci::ReadInquiryScanTypeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, inquiry_scan_type); send_event_(std::move(packet)); } void DualModeController::WriteInquiryScanType(CommandPacketView command) { void DualModeController::WriteInquiryScanType(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryScanTypeView::Create( auto command_view = gd_hci::WriteInquiryScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading Loading @@ -852,6 +907,16 @@ void DualModeController::WriteClassOfDevice(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageTimeout(CommandPacketView command) { auto command_view = gd_hci::ReadPageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t page_timeout = 0x2000; auto packet = bluetooth::hci::ReadPageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_timeout); send_event_(std::move(packet)); } void DualModeController::WritePageTimeout(CommandPacketView command) { void DualModeController::WritePageTimeout(CommandPacketView command) { auto command_view = gd_hci::WritePageTimeoutView::Create( auto command_view = gd_hci::WritePageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading Loading @@ -1058,6 +1123,27 @@ void DualModeController::WriteVoiceSetting(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadNumberOfSupportedIac(CommandPacketView command) { auto command_view = gd_hci::ReadNumberOfSupportedIacView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint8_t num_support_iac = 0x1; auto packet = bluetooth::hci::ReadNumberOfSupportedIacCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, num_support_iac); send_event_(std::move(packet)); } void DualModeController::ReadCurrentIacLap(CommandPacketView command) { auto command_view = gd_hci::ReadCurrentIacLapView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::Lap lap; lap.lap_ = 0x30; auto packet = bluetooth::hci::ReadCurrentIacLapCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, {lap}); send_event_(std::move(packet)); } void DualModeController::WriteCurrentIacLap(CommandPacketView command) { void DualModeController::WriteCurrentIacLap(CommandPacketView command) { auto command_view = gd_hci::WriteCurrentIacLapView::Create( auto command_view = gd_hci::WriteCurrentIacLapView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -1067,6 +1153,37 @@ void DualModeController::WriteCurrentIacLap(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageScanActivity(CommandPacketView command) { auto command_view = gd_hci::ReadPageScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t interval = 0x1000; uint16_t window = 0x0012; auto packet = bluetooth::hci::ReadPageScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, interval, window); send_event_(std::move(packet)); } void DualModeController::WritePageScanActivity(CommandPacketView command) { auto command_view = gd_hci::WritePageScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto packet = bluetooth::hci::WritePageScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS); send_event_(std::move(packet)); } void DualModeController::ReadInquiryScanActivity(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t interval = 0x1000; uint16_t window = 0x0012; auto packet = bluetooth::hci::ReadInquiryScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, interval, window); send_event_(std::move(packet)); } void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryScanActivityView::Create( auto command_view = gd_hci::WriteInquiryScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -1076,6 +1193,15 @@ void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadScanEnable(CommandPacketView command) { auto command_view = gd_hci::ReadScanEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto packet = bluetooth::hci::ReadScanEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, gd_hci::ScanEnable::NO_SCANS); send_event_(std::move(packet)); } void DualModeController::WriteScanEnable(CommandPacketView command) { void DualModeController::WriteScanEnable(CommandPacketView command) { auto command_view = gd_hci::WriteScanEnableView::Create( auto command_view = gd_hci::WriteScanEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +33 −0 Original line number Original line Diff line number Diff line Loading @@ -235,12 +235,27 @@ class DualModeController : public Device { // 7.3.12 // 7.3.12 void ReadLocalName(CommandPacketView args); void ReadLocalName(CommandPacketView args); // 7.3.15 void ReadPageTimeout(CommandPacketView args); // 7.3.16 // 7.3.16 void WritePageTimeout(CommandPacketView args); void WritePageTimeout(CommandPacketView args); // 7.3.17 void ReadScanEnable(CommandPacketView args); // 7.3.18 // 7.3.18 void WriteScanEnable(CommandPacketView args); void WriteScanEnable(CommandPacketView args); // 7.3.19 void ReadPageScanActivity(CommandPacketView args); // 7.3.20 void WritePageScanActivity(CommandPacketView args); // 7.3.21 void ReadInquiryScanActivity(CommandPacketView args); // 7.3.22 // 7.3.22 void WriteInquiryScanActivity(CommandPacketView args); void WriteInquiryScanActivity(CommandPacketView args); Loading @@ -262,15 +277,30 @@ class DualModeController : public Device { // 7.3.42 // 7.3.42 void WriteLinkSupervisionTimeout(CommandPacketView args); void WriteLinkSupervisionTimeout(CommandPacketView args); // 7.3.43 void ReadNumberOfSupportedIac(CommandPacketView args); // 7.3.44 void ReadCurrentIacLap(CommandPacketView args); // 7.3.45 // 7.3.45 void WriteCurrentIacLap(CommandPacketView args); void WriteCurrentIacLap(CommandPacketView args); // 7.3.47 void ReadInquiryScanType(CommandPacketView args); // 7.3.48 // 7.3.48 void WriteInquiryScanType(CommandPacketView args); void WriteInquiryScanType(CommandPacketView args); // 7.3.49 void ReadInquiryMode(CommandPacketView args); // 7.3.50 // 7.3.50 void WriteInquiryMode(CommandPacketView args); void WriteInquiryMode(CommandPacketView args); // 7.3.52 void ReadPageScanType(CommandPacketView args); // 7.3.52 // 7.3.52 void WritePageScanType(CommandPacketView args); void WritePageScanType(CommandPacketView args); Loading @@ -283,6 +313,9 @@ class DualModeController : public Device { // 7.3.59 // 7.3.59 void WriteSimplePairingMode(CommandPacketView args); void WriteSimplePairingMode(CommandPacketView args); // 7.3.61 void ReadInquiryResponseTransmitPowerLevel(CommandPacketView args); // 7.3.79 // 7.3.79 void WriteLeHostSupport(CommandPacketView args); void WriteLeHostSupport(CommandPacketView args); Loading Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +126 −0 Original line number Original line Diff line number Diff line Loading @@ -119,14 +119,19 @@ DualModeController::DualModeController(const std::string& properties_filename, u UserConfirmationRequestNegativeReply); UserConfirmationRequestNegativeReply); SET_HANDLER(OpCode::IO_CAPABILITY_REQUEST_NEGATIVE_REPLY, SET_HANDLER(OpCode::IO_CAPABILITY_REQUEST_NEGATIVE_REPLY, IoCapabilityRequestNegativeReply); IoCapabilityRequestNegativeReply); SET_HANDLER(OpCode::READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL, ReadInquiryResponseTransmitPowerLevel); SET_HANDLER(OpCode::WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode); SET_HANDLER(OpCode::WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode); SET_HANDLER(OpCode::WRITE_LE_HOST_SUPPORT, WriteLeHostSupport); SET_HANDLER(OpCode::WRITE_LE_HOST_SUPPORT, WriteLeHostSupport); SET_HANDLER(OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, SET_HANDLER(OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, WriteSecureConnectionsHostSupport); WriteSecureConnectionsHostSupport); SET_HANDLER(OpCode::SET_EVENT_MASK, SetEventMask); SET_HANDLER(OpCode::SET_EVENT_MASK, SetEventMask); SET_HANDLER(OpCode::READ_INQUIRY_MODE, ReadInquiryMode); SET_HANDLER(OpCode::WRITE_INQUIRY_MODE, WriteInquiryMode); SET_HANDLER(OpCode::WRITE_INQUIRY_MODE, WriteInquiryMode); SET_HANDLER(OpCode::READ_PAGE_SCAN_TYPE, ReadPageScanType); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_TYPE, WritePageScanType); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_TYPE, WritePageScanType); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_TYPE, WriteInquiryScanType); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_TYPE, WriteInquiryScanType); SET_HANDLER(OpCode::READ_INQUIRY_SCAN_TYPE, ReadInquiryScanType); SET_HANDLER(OpCode::AUTHENTICATION_REQUESTED, AuthenticationRequested); SET_HANDLER(OpCode::AUTHENTICATION_REQUESTED, AuthenticationRequested); SET_HANDLER(OpCode::SET_CONNECTION_ENCRYPTION, SetConnectionEncryption); SET_HANDLER(OpCode::SET_CONNECTION_ENCRYPTION, SetConnectionEncryption); SET_HANDLER(OpCode::CHANGE_CONNECTION_LINK_KEY, ChangeConnectionLinkKey); SET_HANDLER(OpCode::CHANGE_CONNECTION_LINK_KEY, ChangeConnectionLinkKey); Loading @@ -134,6 +139,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_HANDLER(OpCode::WRITE_AUTHENTICATION_ENABLE, WriteAuthenticationEnable); SET_HANDLER(OpCode::WRITE_AUTHENTICATION_ENABLE, WriteAuthenticationEnable); SET_HANDLER(OpCode::READ_AUTHENTICATION_ENABLE, ReadAuthenticationEnable); SET_HANDLER(OpCode::READ_AUTHENTICATION_ENABLE, ReadAuthenticationEnable); SET_HANDLER(OpCode::WRITE_CLASS_OF_DEVICE, WriteClassOfDevice); SET_HANDLER(OpCode::WRITE_CLASS_OF_DEVICE, WriteClassOfDevice); SET_HANDLER(OpCode::READ_PAGE_TIMEOUT, ReadPageTimeout); SET_HANDLER(OpCode::WRITE_PAGE_TIMEOUT, WritePageTimeout); SET_HANDLER(OpCode::WRITE_PAGE_TIMEOUT, WritePageTimeout); SET_HANDLER(OpCode::WRITE_LINK_SUPERVISION_TIMEOUT, SET_HANDLER(OpCode::WRITE_LINK_SUPERVISION_TIMEOUT, WriteLinkSupervisionTimeout); WriteLinkSupervisionTimeout); Loading @@ -153,8 +159,14 @@ DualModeController::DualModeController(const std::string& properties_filename, u WriteExtendedInquiryResponse); WriteExtendedInquiryResponse); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, RefreshEncryptionKey); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, RefreshEncryptionKey); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, WriteVoiceSetting); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, WriteVoiceSetting); SET_HANDLER(OpCode::READ_NUMBER_OF_SUPPORTED_IAC, ReadNumberOfSupportedIac); SET_HANDLER(OpCode::READ_CURRENT_IAC_LAP, ReadCurrentIacLap); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, WriteCurrentIacLap); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, WriteCurrentIacLap); SET_HANDLER(OpCode::READ_PAGE_SCAN_ACTIVITY, ReadPageScanActivity); SET_HANDLER(OpCode::WRITE_PAGE_SCAN_ACTIVITY, WritePageScanActivity); SET_HANDLER(OpCode::READ_INQUIRY_SCAN_ACTIVITY, ReadInquiryScanActivity); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, WriteInquiryScanActivity); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, WriteInquiryScanActivity); SET_HANDLER(OpCode::READ_SCAN_ENABLE, ReadScanEnable); SET_HANDLER(OpCode::WRITE_SCAN_ENABLE, WriteScanEnable); SET_HANDLER(OpCode::WRITE_SCAN_ENABLE, WriteScanEnable); SET_HANDLER(OpCode::SET_EVENT_FILTER, SetEventFilter); SET_HANDLER(OpCode::SET_EVENT_FILTER, SetEventFilter); SET_HANDLER(OpCode::INQUIRY, Inquiry); SET_HANDLER(OpCode::INQUIRY, Inquiry); Loading Loading @@ -681,6 +693,19 @@ void DualModeController::IoCapabilityRequestNegativeReply( send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryResponseTransmitPowerLevel( CommandPacketView command) { auto command_view = gd_hci::ReadInquiryResponseTransmitPowerLevelView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint8_t tx_power = 20; // maximum auto packet = bluetooth::hci::ReadInquiryResponseTransmitPowerLevelCompleteBuilder:: Create(kNumCommandPackets, ErrorCode::SUCCESS, tx_power); send_event_(std::move(packet)); } void DualModeController::WriteSimplePairingMode(CommandPacketView command) { void DualModeController::WriteSimplePairingMode(CommandPacketView command) { auto command_view = gd_hci::WriteSimplePairingModeView::Create( auto command_view = gd_hci::WriteSimplePairingModeView::Create( gd_hci::SecurityCommandView::Create(command)); gd_hci::SecurityCommandView::Create(command)); Loading Loading @@ -736,6 +761,16 @@ void DualModeController::SetEventMask(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryMode(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryModeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::InquiryMode inquiry_mode = gd_hci::InquiryMode::STANDARD; auto packet = bluetooth::hci::ReadInquiryModeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, inquiry_mode); send_event_(std::move(packet)); } void DualModeController::WriteInquiryMode(CommandPacketView command) { void DualModeController::WriteInquiryMode(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryModeView::Create( auto command_view = gd_hci::WriteInquiryModeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -747,6 +782,16 @@ void DualModeController::WriteInquiryMode(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageScanType(CommandPacketView command) { auto command_view = gd_hci::ReadPageScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::PageScanType page_scan_type = gd_hci::PageScanType::STANDARD; auto packet = bluetooth::hci::ReadPageScanTypeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_scan_type); send_event_(std::move(packet)); } void DualModeController::WritePageScanType(CommandPacketView command) { void DualModeController::WritePageScanType(CommandPacketView command) { auto command_view = gd_hci::WritePageScanTypeView::Create( auto command_view = gd_hci::WritePageScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -756,6 +801,16 @@ void DualModeController::WritePageScanType(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadInquiryScanType(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::InquiryScanType inquiry_scan_type = gd_hci::InquiryScanType::STANDARD; auto packet = bluetooth::hci::ReadInquiryScanTypeCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, inquiry_scan_type); send_event_(std::move(packet)); } void DualModeController::WriteInquiryScanType(CommandPacketView command) { void DualModeController::WriteInquiryScanType(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryScanTypeView::Create( auto command_view = gd_hci::WriteInquiryScanTypeView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading Loading @@ -852,6 +907,16 @@ void DualModeController::WriteClassOfDevice(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageTimeout(CommandPacketView command) { auto command_view = gd_hci::ReadPageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t page_timeout = 0x2000; auto packet = bluetooth::hci::ReadPageTimeoutCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, page_timeout); send_event_(std::move(packet)); } void DualModeController::WritePageTimeout(CommandPacketView command) { void DualModeController::WritePageTimeout(CommandPacketView command) { auto command_view = gd_hci::WritePageTimeoutView::Create( auto command_view = gd_hci::WritePageTimeoutView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading Loading @@ -1058,6 +1123,27 @@ void DualModeController::WriteVoiceSetting(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadNumberOfSupportedIac(CommandPacketView command) { auto command_view = gd_hci::ReadNumberOfSupportedIacView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint8_t num_support_iac = 0x1; auto packet = bluetooth::hci::ReadNumberOfSupportedIacCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, num_support_iac); send_event_(std::move(packet)); } void DualModeController::ReadCurrentIacLap(CommandPacketView command) { auto command_view = gd_hci::ReadCurrentIacLapView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); gd_hci::Lap lap; lap.lap_ = 0x30; auto packet = bluetooth::hci::ReadCurrentIacLapCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, {lap}); send_event_(std::move(packet)); } void DualModeController::WriteCurrentIacLap(CommandPacketView command) { void DualModeController::WriteCurrentIacLap(CommandPacketView command) { auto command_view = gd_hci::WriteCurrentIacLapView::Create( auto command_view = gd_hci::WriteCurrentIacLapView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -1067,6 +1153,37 @@ void DualModeController::WriteCurrentIacLap(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadPageScanActivity(CommandPacketView command) { auto command_view = gd_hci::ReadPageScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t interval = 0x1000; uint16_t window = 0x0012; auto packet = bluetooth::hci::ReadPageScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, interval, window); send_event_(std::move(packet)); } void DualModeController::WritePageScanActivity(CommandPacketView command) { auto command_view = gd_hci::WritePageScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto packet = bluetooth::hci::WritePageScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS); send_event_(std::move(packet)); } void DualModeController::ReadInquiryScanActivity(CommandPacketView command) { auto command_view = gd_hci::ReadInquiryScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); uint16_t interval = 0x1000; uint16_t window = 0x0012; auto packet = bluetooth::hci::ReadInquiryScanActivityCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, interval, window); send_event_(std::move(packet)); } void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { auto command_view = gd_hci::WriteInquiryScanActivityView::Create( auto command_view = gd_hci::WriteInquiryScanActivityView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading @@ -1076,6 +1193,15 @@ void DualModeController::WriteInquiryScanActivity(CommandPacketView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadScanEnable(CommandPacketView command) { auto command_view = gd_hci::ReadScanEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto packet = bluetooth::hci::ReadScanEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, gd_hci::ScanEnable::NO_SCANS); send_event_(std::move(packet)); } void DualModeController::WriteScanEnable(CommandPacketView command) { void DualModeController::WriteScanEnable(CommandPacketView command) { auto command_view = gd_hci::WriteScanEnableView::Create( auto command_view = gd_hci::WriteScanEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); gd_hci::DiscoveryCommandView::Create(command)); Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +33 −0 Original line number Original line Diff line number Diff line Loading @@ -235,12 +235,27 @@ class DualModeController : public Device { // 7.3.12 // 7.3.12 void ReadLocalName(CommandPacketView args); void ReadLocalName(CommandPacketView args); // 7.3.15 void ReadPageTimeout(CommandPacketView args); // 7.3.16 // 7.3.16 void WritePageTimeout(CommandPacketView args); void WritePageTimeout(CommandPacketView args); // 7.3.17 void ReadScanEnable(CommandPacketView args); // 7.3.18 // 7.3.18 void WriteScanEnable(CommandPacketView args); void WriteScanEnable(CommandPacketView args); // 7.3.19 void ReadPageScanActivity(CommandPacketView args); // 7.3.20 void WritePageScanActivity(CommandPacketView args); // 7.3.21 void ReadInquiryScanActivity(CommandPacketView args); // 7.3.22 // 7.3.22 void WriteInquiryScanActivity(CommandPacketView args); void WriteInquiryScanActivity(CommandPacketView args); Loading @@ -262,15 +277,30 @@ class DualModeController : public Device { // 7.3.42 // 7.3.42 void WriteLinkSupervisionTimeout(CommandPacketView args); void WriteLinkSupervisionTimeout(CommandPacketView args); // 7.3.43 void ReadNumberOfSupportedIac(CommandPacketView args); // 7.3.44 void ReadCurrentIacLap(CommandPacketView args); // 7.3.45 // 7.3.45 void WriteCurrentIacLap(CommandPacketView args); void WriteCurrentIacLap(CommandPacketView args); // 7.3.47 void ReadInquiryScanType(CommandPacketView args); // 7.3.48 // 7.3.48 void WriteInquiryScanType(CommandPacketView args); void WriteInquiryScanType(CommandPacketView args); // 7.3.49 void ReadInquiryMode(CommandPacketView args); // 7.3.50 // 7.3.50 void WriteInquiryMode(CommandPacketView args); void WriteInquiryMode(CommandPacketView args); // 7.3.52 void ReadPageScanType(CommandPacketView args); // 7.3.52 // 7.3.52 void WritePageScanType(CommandPacketView args); void WritePageScanType(CommandPacketView args); Loading @@ -283,6 +313,9 @@ class DualModeController : public Device { // 7.3.59 // 7.3.59 void WriteSimplePairingMode(CommandPacketView args); void WriteSimplePairingMode(CommandPacketView args); // 7.3.61 void ReadInquiryResponseTransmitPowerLevel(CommandPacketView args); // 7.3.79 // 7.3.79 void WriteLeHostSupport(CommandPacketView args); void WriteLeHostSupport(CommandPacketView args); Loading