Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp981228pxb; Wed, 3 Mar 2021 23:23:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO8XmjdfMU9e7o4MWVPQOheGSCUnaYRsqaL5twAPxyf/HUBur6PeAZhHXomfi+91F0qm7Q X-Received: by 2002:a50:e80c:: with SMTP id e12mr2850959edn.229.1614842599807; Wed, 03 Mar 2021 23:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614842599; cv=none; d=google.com; s=arc-20160816; b=glcDZA99Rbwa3A+HixJegmQHU1MKsOuqejCyiJ1GSu5ywoBUX2Rk/1WRvNJn5iFSse LdqhwdSn4pHvVbcrkSCkhw5t0Zu6NpbfxBFlZFgyDnq0FHfXIxw9g/xJ5tmGRfssH8S6 LYH4dTQT5wwTdI00UZyWLMHuqEoNXi9lRZGU5QARs66y4YgOOvB1SPMoAI9UkotqF6ci R34jF/VODtDwmMRvTMvb7HDWq0ashTB3ItTZLjBzxT5DmoygBffB5kLA3uahK6qQSWYn PTh2cyZqOUAyiQp+s918avuwhE69B0xPdb3rtnP9xcpOs/BDHrNvm67136g+zcqnoj+5 L4Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=7CcNTMXA/G6oxQbeohLgrlaaAzwj4u2cgd+yTSSMMvU=; b=zh/KKRv3hiNwBgmZqbrARwsnattjTIcNcHGFStOyWxRHJvRQ7DhOXq+sx59iOmTsMl /hrC8esYDIkqWmqoioeqPfl4HZ/ti+AGQZd0hEPD/oUz5+c91mjfa4otttV4W/Wak80c gBf+LO+OjgpNzN6lrIfiUYN2O0dAD3phJIE7ktisg/0e/jGq+CYZSYrFJPvzSQYaPGNZ rswk1N2vZtoPNrBaydSkjtr6bYVbzUdSEvkSuj1UvJerIuC0pSwWZNRuJoYohr9GXHdA frRXLNXCt15JxajOBvgZohq3kyeIBQ8sXqtbkjgLUeQLTmydIJQVX7CU2jEvfilqHYds 7YmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="m0Wn/FUQ"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si16429878edl.307.2021.03.03.23.22.34; Wed, 03 Mar 2021 23:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="m0Wn/FUQ"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577006AbhCBXBG (ORCPT + 99 others); Tue, 2 Mar 2021 18:01:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238561AbhCBRbU (ORCPT ); Tue, 2 Mar 2021 12:31:20 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8388BC0611BD for ; Tue, 2 Mar 2021 09:07:43 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id o16so3513668wmh.0 for ; Tue, 02 Mar 2021 09:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7CcNTMXA/G6oxQbeohLgrlaaAzwj4u2cgd+yTSSMMvU=; b=m0Wn/FUQx1Y45IaUEp8k0ILlKUKOiplrZERbdjxKU/mYZ1ULH7bkFeaTruo167Vsvw LBa65WB7s4piOzIF/UygFQFoydGOuciSEyqL9wM7dnVJN8ctdZrYuOHeffiVSjedZFVD tCKFbnKeWSm+Nxz3hLeW6Ag/A4U8BL6iNOtjoAL8DTwldTvHD3kHJFXvZcCJRrWtr6Ip 5aAD+Yb7aLhkocyG4E8lDQhEN1riegXix+jR3Q8MxECR5PyQdsPEkm/0oYAj593rvYWb H83qvbZk/Hs8Xkh24q5uuZp+xCNoc4UBVSJ6flOcu7em0x+w8Am7DfXy5UZ+QBPaxOAr H6pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7CcNTMXA/G6oxQbeohLgrlaaAzwj4u2cgd+yTSSMMvU=; b=eUu1KaUK0N8wtbvxQJxLAOyckr/UuWLErAp2gE5EY1ZBeUSskV5vPuDN1kLURgYLUn 6i0emN6fTpHOpwglZ/LVG4l5Rk3c9J3CmgAi1MGdfnUauvatp/7ahQ6qsehAE4yol8q8 MNw0z5+XfLukDa7RYT1MtwCKZ0HVJYS+IX/oi3ymrwrRlwQnXa05ZcNPdQq7CTBLdWeL qBA9GgWIiYV6QIcXyCd/QwknZ9yXGWO8+qRmVlyujQOWqfkBBKEWHnbjeWe8XiY7ttfX Zwb13goO8GrZIQq/Cd3IqfKw5OmbiEDnMttX7ef1XEmKIyiLHUukseoAkjoD90E499ZS frMg== X-Gm-Message-State: AOAM533KOXxCfNdmvvf6gqJaW407+c9ksrKMJ8HMiG7Jc9RlYt1rteEG SCHcIxUcESr07YLgP/PDHaR2tgP6kPEDuJ3sB15GPyG9yj9twWHu X-Received: by 2002:a1c:2155:: with SMTP id h82mr5066607wmh.169.1614704861759; Tue, 02 Mar 2021 09:07:41 -0800 (PST) MIME-Version: 1.0 From: Mihai Emilian Date: Tue, 2 Mar 2021 18:07:30 +0100 Message-ID: Subject: Autopairing To: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Dear bluetooth community, I am trying to create a pairing agent using bluez API in C. The problem that I am trying to solve is autopairing from a known list of MAC addresses (i.e auto-accept pairing for known devices in the list). I tried registering a bluetooth agent with NoInputNoOutput capability. However, when I try to access Pair, I receive Authentication Failed error. Another problem here is that even if I call RequestDefaultAgent after registration, it seems that the bluetooth settings agent (UI) is still called and prompts me to yes/no. I have the following questions: From the api doc: "Special permission might be required to become the default agent" - Is there anything else I have to do to acquire these permissions? - The return value from RequestDefaultAgent and RegisterAgent is void. How can I check whether my agent has been registered/became default? - I also tried trusting the discovered device after registering the agent and trying to make it default, which didn't make any difference - is this required? Here's my source code: https://pastebin.com/Wj3rdHy3 Thank you for your time. Best regards, Mihai