src/connectivity/bluetooth/core/bt-host/hci/bredr_connection_request.cc
// Status is either a Success or an Error value
Status is either a Success or an Error value
Status is either a Success or an Error value
Status BrEdrConnectionRequest::CompleteRequest(Status status) {
  bt_log(DEBUG, "hci-bredr", "connection complete - status: %s", bt_str(status));
  timeout_task_.Cancel();
  if (!status.is_success()) {
    if (state_ == RequestState::kTimedOut) {
      status = Status(HostError::kTimedOut);
    } else if (status.protocol_error() == StatusCode::kUnknownConnectionId) {
      status = Status(HostError::kCanceled);
    }
  }
  return status;
}
Status BrEdrConnectionRequest :: CompleteRequest ( Status status ) { bt_log ( DEBUG , " " , " " , bt_str ( status ) ) ; timeout_task_ . Cancel ( ) ; if ( ! status . is_success ( ) ) { if ( state_ == RequestState :: kTimedOut ) { status = Status ( HostError :: kTimedOut ) ; } else if ( status . protocol_error ( ) == StatusCode :: kUnknownConnectionId ) { status = Status ( HostError :: kCanceled ) ; } } return status ; }
Status is either a Success or an Error value
Status is either a Success or an Error value
// The "Unknown Connection Identifier" error code is returned if this // event was sent due to a successful cancellation via the // HCI_Create_Connection_Cancel command // See Core Spec v5.0 Vol 2, Part E, Section 7.1.7