EXPECT_NE(std::future_status::timeout, result);
}
if (command_queue_.empty()) {
- return ConnectionManagementCommandView::Create(
- CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())));
+ return ConnectionManagementCommandView::Create(AclCommandView::Create(
+ CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>()))));
}
CommandPacketView command_packet_view = GetLastCommand();
- ConnectionManagementCommandView command = ConnectionManagementCommandView::Create(command_packet_view);
+ ConnectionManagementCommandView command =
+ ConnectionManagementCommandView::Create(AclCommandView::Create(command_packet_view));
EXPECT_TRUE(command.IsValid());
EXPECT_EQ(command.GetOpCode(), op_code);
EXPECT_NE(std::future_status::timeout, result);
}
if (command_queue_.empty()) {
- return ConnectionManagementCommandView::Create(
- CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>())));
+ return ConnectionManagementCommandView::Create(AclCommandView::Create(
+ CommandPacketView::Create(PacketView<kLittleEndian>(std::make_shared<std::vector<uint8_t>>()))));
}
CommandPacketView command_packet_view = GetLastCommand();
- ConnectionManagementCommandView command = ConnectionManagementCommandView::Create(command_packet_view);
+ ConnectionManagementCommandView command =
+ ConnectionManagementCommandView::Create(AclCommandView::Create(command_packet_view));
EXPECT_TRUE(command.IsValid());
EXPECT_EQ(command.GetOpCode(), op_code);
test_hci_layer_->IncomingEvent(LeAddDeviceToConnectListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS));
test_hci_layer_->SetCommandFuture();
auto packet = test_hci_layer_->GetCommandPacket(OpCode::LE_CREATE_CONNECTION);
- auto le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
+ auto le_connection_management_command_view =
+ LeConnectionManagementCommandView::Create(AclCommandView::Create(packet));
auto command_view = LeCreateConnectionView::Create(le_connection_management_command_view);
ASSERT_TRUE(command_view.IsValid());
if (use_connect_list_) {
test_hci_layer_->IncomingEvent(LeAddDeviceToConnectListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS));
test_hci_layer_->SetCommandFuture();
auto packet = test_hci_layer_->GetLastCommandPacket(OpCode::LE_CREATE_CONNECTION);
- auto le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
+ auto le_connection_management_command_view =
+ LeConnectionManagementCommandView::Create(AclCommandView::Create(packet));
auto command_view = LeCreateConnectionView::Create(le_connection_management_command_view);
ASSERT_TRUE(command_view.IsValid());
if (use_connect_list_) {
test_hci_layer_->SetCommandFuture();
packet = test_hci_layer_->GetLastCommandPacket(OpCode::LE_REMOVE_DEVICE_FROM_CONNECT_LIST);
- le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
+ le_connection_management_command_view = LeConnectionManagementCommandView::Create(AclCommandView::Create(packet));
auto remove_command_view = LeRemoveDeviceFromConnectListView::Create(le_connection_management_command_view);
ASSERT_TRUE(remove_command_view.IsValid());
test_hci_layer_->IncomingEvent(LeRemoveDeviceFromConnectListCompleteBuilder::Create(0x01, ErrorCode::SUCCESS));
test_hci_layer_->SetCommandFuture();
acl_manager_->CancelLeConnect(remote_with_type);
auto packet = test_hci_layer_->GetLastCommandPacket(OpCode::LE_CREATE_CONNECTION_CANCEL);
- auto le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
+ auto le_connection_management_command_view =
+ LeConnectionManagementCommandView::Create(AclCommandView::Create(packet));
auto command_view = LeCreateConnectionCancelView::Create(le_connection_management_command_view);
ASSERT_TRUE(command_view.IsValid());
test_hci_layer_->SetCommandFuture();
packet = test_hci_layer_->GetLastCommandPacket(OpCode::LE_REMOVE_DEVICE_FROM_CONNECT_LIST);
- le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
+ le_connection_management_command_view = LeConnectionManagementCommandView::Create(AclCommandView::Create(packet));
auto remove_command_view = LeRemoveDeviceFromConnectListView::Create(le_connection_management_command_view);
ASSERT_TRUE(remove_command_view.IsValid());
connection_->LeConnectionUpdate(connection_interval_min, connection_interval_max, connection_latency,
supervision_timeout, 0x10, 0x20);
auto update_packet = test_hci_layer_->GetCommandPacket(OpCode::LE_CONNECTION_UPDATE);
- auto update_view = LeConnectionUpdateView::Create(LeConnectionManagementCommandView::Create(update_packet));
+ auto update_view =
+ LeConnectionUpdateView::Create(LeConnectionManagementCommandView::Create(AclCommandView::Create(update_packet)));
ASSERT_TRUE(update_view.IsValid());
EXPECT_EQ(update_view.GetConnectionHandle(), handle_);
EXPECT_CALL(mock_le_connection_management_callbacks_,
void DualModeController::SniffSubrating(CommandPacketView command) {
auto command_view = gd_hci::SniffSubratingView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
send_event_(gd_hci::SniffSubratingCompleteBuilder::Create(
void DualModeController::ReadRemoteVersionInformation(
CommandPacketView command) {
auto command_view = gd_hci::ReadRemoteVersionInformationView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto status = link_layer_controller_.SendCommandToRemoteByHandle(
void DualModeController::ReadRemoteExtendedFeatures(CommandPacketView command) {
auto command_view = gd_hci::ReadRemoteExtendedFeaturesView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto status = link_layer_controller_.SendCommandToRemoteByHandle(
void DualModeController::SwitchRole(CommandPacketView command) {
auto command_view = gd_hci::SwitchRoleView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto status = link_layer_controller_.SwitchRole(
void DualModeController::ReadRemoteSupportedFeatures(
CommandPacketView command) {
auto command_view = gd_hci::ReadRemoteSupportedFeaturesView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto status = link_layer_controller_.SendCommandToRemoteByHandle(
void DualModeController::ReadClockOffset(CommandPacketView command) {
auto command_view = gd_hci::ReadClockOffsetView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::ChangeConnectionPacketType(CommandPacketView command) {
auto command_view = gd_hci::ChangeConnectionPacketTypeView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::AuthenticationRequested(CommandPacketView command) {
auto command_view = gd_hci::AuthenticationRequestedView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
auto status = link_layer_controller_.AuthenticationRequested(handle);
void DualModeController::SetConnectionEncryption(CommandPacketView command) {
auto command_view = gd_hci::SetConnectionEncryptionView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
uint8_t encryption_enable =
void DualModeController::ChangeConnectionLinkKey(CommandPacketView command) {
auto command_view = gd_hci::ChangeConnectionLinkKeyView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::CentralLinkKey(CommandPacketView command) {
auto command_view = gd_hci::CentralLinkKeyView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint8_t key_flag = static_cast<uint8_t>(command_view.GetKeyFlag());
void DualModeController::HoldMode(CommandPacketView command) {
auto command_view = gd_hci::HoldModeView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
uint16_t hold_mode_max_interval = command_view.GetHoldModeMaxInterval();
void DualModeController::SniffMode(CommandPacketView command) {
auto command_view = gd_hci::SniffModeView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
uint16_t sniff_max_interval = command_view.GetSniffMaxInterval();
void DualModeController::ExitSniffMode(CommandPacketView command) {
auto command_view = gd_hci::ExitSniffModeView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto status =
void DualModeController::QosSetup(CommandPacketView command) {
auto command_view = gd_hci::QosSetupView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
uint8_t service_type = static_cast<uint8_t>(command_view.GetServiceType());
void DualModeController::ReadDefaultLinkPolicySettings(
CommandPacketView command) {
auto command_view = gd_hci::ReadDefaultLinkPolicySettingsView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t settings = link_layer_controller_.ReadDefaultLinkPolicySettings();
auto packet =
void DualModeController::WriteDefaultLinkPolicySettings(
CommandPacketView command) {
auto command_view = gd_hci::WriteDefaultLinkPolicySettingsView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
ErrorCode status = link_layer_controller_.WriteDefaultLinkPolicySettings(
command_view.GetDefaultLinkPolicySettings());
void DualModeController::FlowSpecification(CommandPacketView command) {
auto command_view = gd_hci::FlowSpecificationView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
uint8_t flow_direction =
void DualModeController::WriteLinkPolicySettings(CommandPacketView command) {
auto command_view = gd_hci::WriteLinkPolicySettingsView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::WriteLinkSupervisionTimeout(
CommandPacketView command) {
auto command_view = gd_hci::WriteLinkSupervisionTimeoutView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::AcceptConnectionRequest(CommandPacketView command) {
auto command_view = gd_hci::AcceptConnectionRequestView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
Address addr = command_view.GetBdAddr();
bool try_role_switch = command_view.GetRole() ==
void DualModeController::RejectConnectionRequest(CommandPacketView command) {
auto command_view = gd_hci::RejectConnectionRequestView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
Address addr = command_view.GetBdAddr();
uint8_t reason = static_cast<uint8_t>(command_view.GetReason());
void DualModeController::LeCreateConnection(CommandPacketView command) {
auto command_view = gd_hci::LeCreateConnectionView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
link_layer_controller_.SetLeScanInterval(command_view.GetLeScanInterval());
link_layer_controller_.SetLeScanWindow(command_view.GetLeScanWindow());
void DualModeController::LeConnectionUpdate(CommandPacketView command) {
auto command_view = gd_hci::LeConnectionUpdateView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
ErrorCode status = link_layer_controller_.LeConnectionUpdate(command_view);
void DualModeController::CreateConnection(CommandPacketView command) {
auto command_view = gd_hci::CreateConnectionView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
Address address = command_view.GetBdAddr();
void DualModeController::CreateConnectionCancel(CommandPacketView command) {
auto command_view = gd_hci::CreateConnectionCancelView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
Address address = command_view.GetBdAddr();
void DualModeController::Disconnect(CommandPacketView command) {
auto command_view = gd_hci::DisconnectView::Create(
- gd_hci::ConnectionManagementCommandView::Create(command));
+ gd_hci::ConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();
void DualModeController::LeConnectionCancel(CommandPacketView command) {
auto command_view = gd_hci::LeCreateConnectionCancelView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
ErrorCode status = link_layer_controller_.SetLeConnect(false);
send_event_(bluetooth::hci::LeCreateConnectionCancelCompleteBuilder::Create(
void DualModeController::LeReadConnectListSize(CommandPacketView command) {
auto command_view = gd_hci::LeReadConnectListSizeView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
auto packet = bluetooth::hci::LeReadConnectListSizeCompleteBuilder::Create(
kNumCommandPackets, ErrorCode::SUCCESS,
void DualModeController::LeClearConnectList(CommandPacketView command) {
auto command_view = gd_hci::LeClearConnectListView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
link_layer_controller_.LeConnectListClear();
auto packet = bluetooth::hci::LeClearConnectListCompleteBuilder::Create(
void DualModeController::LeAddDeviceToConnectList(CommandPacketView command) {
auto command_view = gd_hci::LeAddDeviceToConnectListView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
if (link_layer_controller_.LeConnectListFull()) {
void DualModeController::LeRemoveDeviceFromConnectList(
CommandPacketView command) {
auto command_view = gd_hci::LeRemoveDeviceFromConnectListView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint8_t addr_type = static_cast<uint8_t>(command_view.GetAddressType());
void DualModeController::LeReadSuggestedDefaultDataLength(CommandPacketView command) {
auto command_view = gd_hci::LeReadSuggestedDefaultDataLengthView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
send_event_(bluetooth::hci::LeReadSuggestedDefaultDataLengthCompleteBuilder::Create(
kNumCommandPackets, ErrorCode::SUCCESS, kLeMaximumDataLength, kLeMaximumDataTime));
void DualModeController::LeExtendedCreateConnection(CommandPacketView command) {
auto command_view = gd_hci::LeExtendedCreateConnectionView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
ASSERT_LOG(command_view.GetInitiatingPhys() == 1, "Only LE_1M is supported");
auto params = command_view.GetPhyScanParameters();
void DualModeController::LeReadRemoteFeatures(CommandPacketView command) {
auto command_view = gd_hci::LeReadRemoteFeaturesView::Create(
- gd_hci::LeConnectionManagementCommandView::Create(command));
+ gd_hci::LeConnectionManagementCommandView::Create(
+ gd_hci::AclCommandView::Create(command)));
ASSERT(command_view.IsValid());
uint16_t handle = command_view.GetConnectionHandle();