Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +299 −210 File changed.Preview size limit exceeded, changes collapsed. Show changes system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +1 −15 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ class DualModeController : public Device { void HciWriteLeHostSupport(packets::PacketView<true> args); // 7.3.92 void HciWriteSecureConnectionHostSupport(packets::PacketView<true> args); void HciWriteSecureConnectionsHostSupport(packets::PacketView<true> args); // Informational Parameters Commands // Bluetooth Core Specification Version 4.2 Volume 2 Part E 7.4 Loading Loading @@ -432,22 +432,8 @@ class DualModeController : public Device { // Creates a command complete event and sends it back to the HCI. void SendCommandComplete(hci::OpCode command_opcode, const std::vector<uint8_t>& return_parameters) const; // Sends a command complete event with no return parameters. void SendCommandCompleteSuccess(bluetooth::hci::OpCode command_opcode) const; void SendCommandCompleteUnknownOpCodeEvent(uint16_t command_opcode) const; // Sends a command complete event with no return parameters. void SendCommandCompleteOnlyStatus(bluetooth::hci::OpCode command_opcode, bluetooth::hci::ErrorCode status) const; // Creates a command status event and sends it back to the HCI. void SendCommandStatus(bluetooth::hci::ErrorCode status, bluetooth::hci::OpCode command_opcode) const; // Sends a command status event with default event parameters. void SendCommandStatusSuccess(bluetooth::hci::OpCode command_opcode) const; // Callbacks to send packets back to the HCI. std::function<void(std::shared_ptr<std::vector<uint8_t>>)> send_acl_; std::function<void(std::shared_ptr<bluetooth::hci::EventPacketBuilder>)> Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +10 −10 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ using namespace test_vendor_lib::packets; namespace test_vendor_lib { constexpr uint16_t kNumCommandPackets = 0x01; // TODO: Model Rssi? static uint8_t GetRssi() { static uint8_t rssi = 0; Loading Loading @@ -109,15 +111,13 @@ hci::Status LinkLayerController::SendAclToRemote(AclPacketView acl_packet) { static_cast<int>(acl_packet.size())); ScheduleTask(milliseconds(5), [this, handle]() { std::unique_ptr<bluetooth::packet::RawBuilder> raw_builder_ptr = std::make_unique<bluetooth::packet::RawBuilder>(); raw_builder_ptr->AddOctets1(0x01); raw_builder_ptr->AddOctets2(handle); raw_builder_ptr->AddOctets2(0x01); auto packet = bluetooth::hci::EventPacketBuilder::Create( bluetooth::hci::EventCode::NUMBER_OF_COMPLETED_PACKETS, std::move(raw_builder_ptr)); std::vector<bluetooth::hci::CompletedPackets> completed_packets; bluetooth::hci::CompletedPackets cp; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets); send_event_(std::move(packet)); }); Loading Loading @@ -473,7 +473,7 @@ void LinkLayerController::IncomingInquiryResponsePacket( std::unique_ptr<bluetooth::packet::RawBuilder> raw_builder_ptr = std::make_unique<bluetooth::packet::RawBuilder>(); raw_builder_ptr->AddOctets1(0x01); // num_responses raw_builder_ptr->AddOctets1(kNumCommandPackets); raw_builder_ptr->AddAddress(inquiry_response.GetSourceAddress()); raw_builder_ptr->AddOctets1(inquiry_response.GetPageScanRepetitionMode()); raw_builder_ptr->AddOctets1(0x00); // _reserved_ Loading Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +299 −210 File changed.Preview size limit exceeded, changes collapsed. Show changes
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +1 −15 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ class DualModeController : public Device { void HciWriteLeHostSupport(packets::PacketView<true> args); // 7.3.92 void HciWriteSecureConnectionHostSupport(packets::PacketView<true> args); void HciWriteSecureConnectionsHostSupport(packets::PacketView<true> args); // Informational Parameters Commands // Bluetooth Core Specification Version 4.2 Volume 2 Part E 7.4 Loading Loading @@ -432,22 +432,8 @@ class DualModeController : public Device { // Creates a command complete event and sends it back to the HCI. void SendCommandComplete(hci::OpCode command_opcode, const std::vector<uint8_t>& return_parameters) const; // Sends a command complete event with no return parameters. void SendCommandCompleteSuccess(bluetooth::hci::OpCode command_opcode) const; void SendCommandCompleteUnknownOpCodeEvent(uint16_t command_opcode) const; // Sends a command complete event with no return parameters. void SendCommandCompleteOnlyStatus(bluetooth::hci::OpCode command_opcode, bluetooth::hci::ErrorCode status) const; // Creates a command status event and sends it back to the HCI. void SendCommandStatus(bluetooth::hci::ErrorCode status, bluetooth::hci::OpCode command_opcode) const; // Sends a command status event with default event parameters. void SendCommandStatusSuccess(bluetooth::hci::OpCode command_opcode) const; // Callbacks to send packets back to the HCI. std::function<void(std::shared_ptr<std::vector<uint8_t>>)> send_acl_; std::function<void(std::shared_ptr<bluetooth::hci::EventPacketBuilder>)> Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +10 −10 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ using namespace test_vendor_lib::packets; namespace test_vendor_lib { constexpr uint16_t kNumCommandPackets = 0x01; // TODO: Model Rssi? static uint8_t GetRssi() { static uint8_t rssi = 0; Loading Loading @@ -109,15 +111,13 @@ hci::Status LinkLayerController::SendAclToRemote(AclPacketView acl_packet) { static_cast<int>(acl_packet.size())); ScheduleTask(milliseconds(5), [this, handle]() { std::unique_ptr<bluetooth::packet::RawBuilder> raw_builder_ptr = std::make_unique<bluetooth::packet::RawBuilder>(); raw_builder_ptr->AddOctets1(0x01); raw_builder_ptr->AddOctets2(handle); raw_builder_ptr->AddOctets2(0x01); auto packet = bluetooth::hci::EventPacketBuilder::Create( bluetooth::hci::EventCode::NUMBER_OF_COMPLETED_PACKETS, std::move(raw_builder_ptr)); std::vector<bluetooth::hci::CompletedPackets> completed_packets; bluetooth::hci::CompletedPackets cp; cp.connection_handle_ = handle; cp.host_num_of_completed_packets_ = kNumCommandPackets; completed_packets.push_back(cp); auto packet = bluetooth::hci::NumberOfCompletedPacketsBuilder::Create( completed_packets); send_event_(std::move(packet)); }); Loading Loading @@ -473,7 +473,7 @@ void LinkLayerController::IncomingInquiryResponsePacket( std::unique_ptr<bluetooth::packet::RawBuilder> raw_builder_ptr = std::make_unique<bluetooth::packet::RawBuilder>(); raw_builder_ptr->AddOctets1(0x01); // num_responses raw_builder_ptr->AddOctets1(kNumCommandPackets); raw_builder_ptr->AddAddress(inquiry_response.GetSourceAddress()); raw_builder_ptr->AddOctets1(inquiry_response.GetPageScanRepetitionMode()); raw_builder_ptr->AddOctets1(0x00); // _reserved_ Loading