Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38af401b authored by Myles Watson's avatar Myles Watson
Browse files

Controller: Set host support flag for Secure Connections

Bug: 180137651
Tag: #gd-refactor
Test: cert/run
Change-Id: I74eac7315defd955875a0b744a67788c0d9ca97c
parent 4794dc40
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ struct Controller::impl {
    // SSP is managed by security layer once enabled
    if (!common::init_flags::gd_security_is_enabled()) {
      write_simple_pairing_mode(Enable::ENABLED);
      hci_->EnqueueCommand(
          WriteSecureConnectionsHostSupportBuilder::Create(Enable::ENABLED),
          handler->BindOnceOn(this, &Controller::impl::write_secure_connections_host_support_complete_handler));
    }
    hci_->EnqueueCommand(ReadLocalNameBuilder::Create(),
                         handler->BindOnceOn(this, &Controller::impl::read_local_name_complete_handler));
@@ -189,6 +192,13 @@ struct Controller::impl {
    acl_monitor_credits_callback_ = {};
  }

  void write_secure_connections_host_support_complete_handler(CommandCompleteView view) {
    auto complete_view = WriteSecureConnectionsHostSupportCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
    ErrorCode status = complete_view.GetStatus();
    ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
  }

  void read_local_name_complete_handler(CommandCompleteView view) {
    auto complete_view = ReadLocalNameCompleteView::Create(view);
    ASSERT(complete_view.IsValid());