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

Commit b8b071e8 authored by Myles Watson's avatar Myles Watson
Browse files

Controller: Warn on LeSetEventMask error codes

Bug: 239662211
Test: cert/run
Tag: #compatibility
Change-Id: Ib7769c0d7a2a3783d82cd9b561d8c38cca7b9c14
parent cc7e04e1
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -557,8 +557,18 @@ struct Controller::impl {

  void le_set_event_mask(uint64_t le_event_mask) {
    std::unique_ptr<LeSetEventMaskBuilder> packet = LeSetEventMaskBuilder::Create(le_event_mask);
    hci_->EnqueueCommand(std::move(packet), module_.GetHandler()->BindOnceOn(
                                                this, &Controller::impl::check_status<LeSetEventMaskCompleteView>));
    hci_->EnqueueCommand(
        std::move(packet), module_.GetHandler()->BindOnceOn(this, &Controller::impl::check_le_set_event_mask_status));
  }

  void check_le_set_event_mask_status(CommandCompleteView view) {
    ASSERT(view.IsValid());
    auto status_view = LeSetEventMaskCompleteView::Create(view);
    ASSERT(status_view.IsValid());
    auto status = status_view.GetStatus();
    if (status != ErrorCode::SUCCESS) {
      LOG_WARN("Unexpected return status %s", ErrorCodeText(status).c_str());
    }
  }

  template <class T>