Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +30 −5 Original line number Original line Diff line number Diff line Loading @@ -294,6 +294,9 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_SUPPORTED(WRITE_CONNECTION_ACCEPT_TIMEOUT, WriteConnectionAcceptTimeout); SET_SUPPORTED(WRITE_CONNECTION_ACCEPT_TIMEOUT, WriteConnectionAcceptTimeout); SET_SUPPORTED(LE_SET_ADDRESS_RESOLUTION_ENABLE, LeSetAddressResolutionEnable); SET_SUPPORTED(LE_SET_ADDRESS_RESOLUTION_ENABLE, LeSetAddressResolutionEnable); SET_SUPPORTED(LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, LeSetResovalablePrivateAddressTimeout); SET_SUPPORTED(LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, LeSetResovalablePrivateAddressTimeout); SET_SUPPORTED(READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE, ReadSynchronousFlowControlEnable); SET_SUPPORTED(WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE, WriteSynchronousFlowControlEnable); #undef SET_HANDLER #undef SET_HANDLER #undef SET_SUPPORTED #undef SET_SUPPORTED properties_.SetSupportedCommands(supported_commands); properties_.SetSupportedCommands(supported_commands); Loading Loading @@ -337,10 +340,8 @@ void DualModeController::HandleAcl(std::shared_ptr<std::vector<uint8_t>> packet) cp.connection_handle_ = handle; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); completed_packets.push_back(cp); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets)); completed_packets)); } return; return; } } Loading @@ -360,7 +361,7 @@ void DualModeController::HandleSco(std::shared_ptr<std::vector<uint8_t>> packet) cp.connection_handle_ = handle; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); completed_packets.push_back(cp); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { if (properties_.GetSynchronousFlowControl()) { send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets)); completed_packets)); } } Loading Loading @@ -1449,6 +1450,30 @@ void DualModeController::WriteScanEnable(CommandView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadSynchronousFlowControlEnable(CommandView command) { auto command_view = gd_hci::ReadSynchronousFlowControlEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto enabled = bluetooth::hci::Enable::DISABLED; if (properties_.GetSynchronousFlowControl()) { enabled = bluetooth::hci::Enable::ENABLED; } auto packet = bluetooth::hci::ReadSynchronousFlowControlEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, enabled); send_event_(std::move(packet)); } void DualModeController::WriteSynchronousFlowControlEnable(CommandView command) { auto command_view = gd_hci::WriteSynchronousFlowControlEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto enabled = command_view.GetEnable() == bluetooth::hci::Enable::ENABLED; properties_.SetSynchronousFlowControl(enabled); auto packet = bluetooth::hci::WriteSynchronousFlowControlEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS); send_event_(std::move(packet)); } void DualModeController::SetEventFilter(CommandView command) { void DualModeController::SetEventFilter(CommandView command) { auto command_view = gd_hci::SetEventFilterView::Create(command); auto command_view = gd_hci::SetEventFilterView::Create(command); ASSERT(command_view.IsValid()); ASSERT(command_view.IsValid()); Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -289,6 +289,12 @@ class DualModeController : public Device { // 7.3.28 // 7.3.28 void WriteVoiceSetting(CommandView args); void WriteVoiceSetting(CommandView args); // 7.3.36 void ReadSynchronousFlowControlEnable(CommandView args); // 7.3.37 void WriteSynchronousFlowControlEnable(CommandView args); // 7.3.39 // 7.3.39 void HostBufferSize(CommandView args); void HostBufferSize(CommandView args); Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +1 −3 Original line number Original line Diff line number Diff line Loading @@ -164,9 +164,7 @@ ErrorCode LinkLayerController::SendAclToRemote( completed_packets.push_back(cp); completed_packets.push_back(cp); auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets); completed_packets); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { send_event_(std::move(packet)); send_event_(std::move(packet)); } }); }); auto acl_payload = acl_packet.GetPayload(); auto acl_payload = acl_packet.GetPayload(); Loading system/vendor_libs/test_vendor_lib/model/devices/device_properties.h +9 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,14 @@ class DeviceProperties { return num_sco_data_packets_; return num_sco_data_packets_; } } bool GetSynchronousFlowControl() const { return sco_flow_control_; } void SetSynchronousFlowControl(bool sco_flow_control) { sco_flow_control_ = sco_flow_control; } const Address& GetAddress() const { const Address& GetAddress() const { return address_; return address_; } } Loading Loading @@ -391,6 +399,7 @@ class DeviceProperties { uint8_t sco_data_packet_size_; uint8_t sco_data_packet_size_; uint16_t num_acl_data_packets_; uint16_t num_acl_data_packets_; uint16_t num_sco_data_packets_; uint16_t num_sco_data_packets_; bool sco_flow_control_{false}; uint8_t version_; uint8_t version_; uint16_t revision_; uint16_t revision_; uint8_t lmp_pal_version_; uint8_t lmp_pal_version_; Loading Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +30 −5 Original line number Original line Diff line number Diff line Loading @@ -294,6 +294,9 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_SUPPORTED(WRITE_CONNECTION_ACCEPT_TIMEOUT, WriteConnectionAcceptTimeout); SET_SUPPORTED(WRITE_CONNECTION_ACCEPT_TIMEOUT, WriteConnectionAcceptTimeout); SET_SUPPORTED(LE_SET_ADDRESS_RESOLUTION_ENABLE, LeSetAddressResolutionEnable); SET_SUPPORTED(LE_SET_ADDRESS_RESOLUTION_ENABLE, LeSetAddressResolutionEnable); SET_SUPPORTED(LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, LeSetResovalablePrivateAddressTimeout); SET_SUPPORTED(LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, LeSetResovalablePrivateAddressTimeout); SET_SUPPORTED(READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE, ReadSynchronousFlowControlEnable); SET_SUPPORTED(WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE, WriteSynchronousFlowControlEnable); #undef SET_HANDLER #undef SET_HANDLER #undef SET_SUPPORTED #undef SET_SUPPORTED properties_.SetSupportedCommands(supported_commands); properties_.SetSupportedCommands(supported_commands); Loading Loading @@ -337,10 +340,8 @@ void DualModeController::HandleAcl(std::shared_ptr<std::vector<uint8_t>> packet) cp.connection_handle_ = handle; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); completed_packets.push_back(cp); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets)); completed_packets)); } return; return; } } Loading @@ -360,7 +361,7 @@ void DualModeController::HandleSco(std::shared_ptr<std::vector<uint8_t>> packet) cp.connection_handle_ = handle; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); completed_packets.push_back(cp); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { if (properties_.GetSynchronousFlowControl()) { send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( send_event_(bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets)); completed_packets)); } } Loading Loading @@ -1449,6 +1450,30 @@ void DualModeController::WriteScanEnable(CommandView command) { send_event_(std::move(packet)); send_event_(std::move(packet)); } } void DualModeController::ReadSynchronousFlowControlEnable(CommandView command) { auto command_view = gd_hci::ReadSynchronousFlowControlEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto enabled = bluetooth::hci::Enable::DISABLED; if (properties_.GetSynchronousFlowControl()) { enabled = bluetooth::hci::Enable::ENABLED; } auto packet = bluetooth::hci::ReadSynchronousFlowControlEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS, enabled); send_event_(std::move(packet)); } void DualModeController::WriteSynchronousFlowControlEnable(CommandView command) { auto command_view = gd_hci::WriteSynchronousFlowControlEnableView::Create( gd_hci::DiscoveryCommandView::Create(command)); ASSERT(command_view.IsValid()); auto enabled = command_view.GetEnable() == bluetooth::hci::Enable::ENABLED; properties_.SetSynchronousFlowControl(enabled); auto packet = bluetooth::hci::WriteSynchronousFlowControlEnableCompleteBuilder::Create( kNumCommandPackets, ErrorCode::SUCCESS); send_event_(std::move(packet)); } void DualModeController::SetEventFilter(CommandView command) { void DualModeController::SetEventFilter(CommandView command) { auto command_view = gd_hci::SetEventFilterView::Create(command); auto command_view = gd_hci::SetEventFilterView::Create(command); ASSERT(command_view.IsValid()); ASSERT(command_view.IsValid()); Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -289,6 +289,12 @@ class DualModeController : public Device { // 7.3.28 // 7.3.28 void WriteVoiceSetting(CommandView args); void WriteVoiceSetting(CommandView args); // 7.3.36 void ReadSynchronousFlowControlEnable(CommandView args); // 7.3.37 void WriteSynchronousFlowControlEnable(CommandView args); // 7.3.39 // 7.3.39 void HostBufferSize(CommandView args); void HostBufferSize(CommandView args); Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +1 −3 Original line number Original line Diff line number Diff line Loading @@ -164,9 +164,7 @@ ErrorCode LinkLayerController::SendAclToRemote( completed_packets.push_back(cp); completed_packets.push_back(cp); auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets); completed_packets); if (properties_.IsUnmasked(EventCode::NUMBER_OF_COMPLETED_PACKETS)) { send_event_(std::move(packet)); send_event_(std::move(packet)); } }); }); auto acl_payload = acl_packet.GetPayload(); auto acl_payload = acl_packet.GetPayload(); Loading
system/vendor_libs/test_vendor_lib/model/devices/device_properties.h +9 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,14 @@ class DeviceProperties { return num_sco_data_packets_; return num_sco_data_packets_; } } bool GetSynchronousFlowControl() const { return sco_flow_control_; } void SetSynchronousFlowControl(bool sco_flow_control) { sco_flow_control_ = sco_flow_control; } const Address& GetAddress() const { const Address& GetAddress() const { return address_; return address_; } } Loading Loading @@ -391,6 +399,7 @@ class DeviceProperties { uint8_t sco_data_packet_size_; uint8_t sco_data_packet_size_; uint16_t num_acl_data_packets_; uint16_t num_acl_data_packets_; uint16_t num_sco_data_packets_; uint16_t num_sco_data_packets_; bool sco_flow_control_{false}; uint8_t version_; uint8_t version_; uint16_t revision_; uint16_t revision_; uint8_t lmp_pal_version_; uint8_t lmp_pal_version_; Loading