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

Commit 18e821ec authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "GD HCI: handle link key notification event"

parents 7d6b5ace 9bb4b459
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,8 @@ struct ClassicSecurityManager::impl {
                                     Bind(&impl::on_request_event, common::Unretained(this)), handler_);
                                     Bind(&impl::on_request_event, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::ENCRYPTION_KEY_REFRESH_COMPLETE,
    hci_layer_->RegisterEventHandler(EventCode::ENCRYPTION_KEY_REFRESH_COMPLETE,
                                     Bind(&impl::on_complete_event, common::Unretained(this)), handler_);
                                     Bind(&impl::on_complete_event, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::LINK_KEY_NOTIFICATION,
                                     Bind(&impl::on_link_key_notification, common::Unretained(this)), handler_);
  }
  }


  void Stop() {
  void Stop() {
@@ -224,6 +226,12 @@ struct ClassicSecurityManager::impl {
    LOG_DEBUG("receive complete event %d", (uint8_t)event_code);
    LOG_DEBUG("receive complete event %d", (uint8_t)event_code);
  }
  }


  void on_link_key_notification(EventPacketView packet) {
    auto view = LinkKeyNotificationView::Create(packet);
    ASSERT(view.IsValid());
    LOG_DEBUG("receive link key notification, key type %d", (uint8_t)view.GetKeyType());
  }

  void on_command_complete(CommandCompleteView status) {
  void on_command_complete(CommandCompleteView status) {
    if (client_handler_ != nullptr) {
    if (client_handler_ != nullptr) {
      client_handler_->Post(common::BindOnce(&ClassicSecurityCommandCallbacks::OnCommandComplete,
      client_handler_->Post(common::BindOnce(&ClassicSecurityCommandCallbacks::OnCommandComplete,