using packet::RawBuilder;
constexpr std::chrono::seconds kTimeout = std::chrono::seconds(2);
+const AddressWithType empty_address_with_type = hci::AddressWithType();
PacketView<kLittleEndian> GetPacketView(std::unique_ptr<packet::BasePacketBuilder> packet) {
auto bytes = std::make_shared<std::vector<uint8_t>>();
os::Handler* client_handler_ = nullptr;
Address remote;
AddressWithType my_initiating_address;
+ const bool use_connect_list_ = true; // gd currently only supports connect list
std::future<void> GetConnectionFuture() {
ASSERT_LOG(mock_connection_callback_.connection_promise_ == nullptr, "Promises promises ... Only one at a time");
auto le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
auto command_view = LeCreateConnectionView::Create(le_connection_management_command_view);
ASSERT_TRUE(command_view.IsValid());
- EXPECT_EQ(command_view.GetPeerAddress(), remote);
- EXPECT_EQ(command_view.GetPeerAddressType(), AddressType::PUBLIC_DEVICE_ADDRESS);
+ if (use_connect_list_) {
+ ASSERT_EQ(command_view.GetPeerAddress(), empty_address_with_type.GetAddress());
+ ASSERT_EQ(command_view.GetPeerAddressType(), empty_address_with_type.GetAddressType());
+ } else {
+ ASSERT_EQ(command_view.GetPeerAddress(), remote);
+ ASSERT_EQ(command_view.GetPeerAddressType(), AddressType::PUBLIC_DEVICE_ADDRESS);
+ }
test_hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01));
auto le_connection_management_command_view = LeConnectionManagementCommandView::Create(packet);
auto command_view = LeCreateConnectionView::Create(le_connection_management_command_view);
ASSERT_TRUE(command_view.IsValid());
- EXPECT_EQ(command_view.GetPeerAddress(), remote);
+ if (use_connect_list_) {
+ ASSERT_EQ(command_view.GetPeerAddress(), hci::Address::kEmpty);
+ } else {
+ ASSERT_EQ(command_view.GetPeerAddress(), remote);
+ }
EXPECT_EQ(command_view.GetPeerAddressType(), AddressType::PUBLIC_DEVICE_ADDRESS);
test_hci_layer_->IncomingEvent(LeCreateConnectionStatusBuilder::Create(ErrorCode::SUCCESS, 0x01));