Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp82209rwb; Wed, 10 Aug 2022 15:17:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR68MY/yenIVQXka13VEt4XowPncnHKGBdY/NFQogPTHCQs+DxeRmjQ9lsfFANe4fC6ly6E8 X-Received: by 2002:a17:907:3fa8:b0:730:a2d0:3a56 with SMTP id hr40-20020a1709073fa800b00730a2d03a56mr21685378ejc.460.1660169844304; Wed, 10 Aug 2022 15:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660169844; cv=none; d=google.com; s=arc-20160816; b=Hf2tS5hPtFGx9lm9GSnGmjiD/Tn6aZ/KHTZYz5YfHRAoAGVnQ1ncv/wXRV0kbSk8vp zQYN2UKG/LGQ40d0chTiw2vN3nTboWu5D866QAX2MYmEw2U+/K+qjynv9078mZ3Mnfgv Gv1ObYbshVrxYhtW7xFazquoX89OmEGPgyMHH9KBFC/BsD+Q+f8HT/G/0I2IQIzS6FgP QmlylIT3qVBV/BucCadJ7SbZ9U0Cj3Y16e0z/u4EGnVMuxkqp+EzIhnaqQrtknAU+Yf3 kOkJs/gWvvWaUmJGMwfC3cusPfl+9XLAghyy51k4iDe+ZPjfZmHfK2iI2AKTo8gLTfsJ rGFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cGpW4EhXIatXeLfl5fsgVMh5RNSm7d4sTNUGMrfZ+vw=; b=LOeYvIA4YuEqS/ACmc0GEGdXb18ujddJ89Cp82jNjOkFrHFplfBM1Ac9SwI1HqP8MZ xGVVtO6gcP4WyMTEmXP1mFEjJ2BR88kSRRM1AXvbWcGcUPt8MkRaD2tL2/5PT3JxvI/a pyAsU5JHs2qCdyR6H/PoIIHjtn4AbVif6xsuZ6X3wcMhGM/YiADCyr5CoOpsAqJZRT0l P0lAMYBcKM3KC272KFLgaxkLkhQE4dbaqESiHhiG9a5YFkAZf1lgdBam8xPgbIPmJXYz GIdUw1fPzjrEeT92rVK91MuyMj/uMW37saeM9vfNnttsn58rTnTyy9HHG3duW7zPBUfp hIKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DHG6EWBN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb9-20020a170907160900b0073168448840si6247455ejc.204.2022.08.10.15.15.58; Wed, 10 Aug 2022 15:17:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DHG6EWBN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233265AbiHJWPB (ORCPT + 99 others); Wed, 10 Aug 2022 18:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiHJWPA (ORCPT ); Wed, 10 Aug 2022 18:15:00 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A963832DC for ; Wed, 10 Aug 2022 15:14:59 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id gk3so30223598ejb.8 for ; Wed, 10 Aug 2022 15:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=cGpW4EhXIatXeLfl5fsgVMh5RNSm7d4sTNUGMrfZ+vw=; b=DHG6EWBNZN1N4Azrdu3oSTv8xz1dw+93gD3YrRpalyNSIauFV7L+e26KjT8Omb99/C An0ZlPhXfD3SNA0b88HCIxHzhQ6RN8guzrGvlAT1J40psgnaXANv9fBC/7xk4FZffbPM EAbWulMaKzE7wOTUWMVBZpENvUBOQuqwzXiIjA3NmgROkjnK71GLcHj57YDSOD5hDK7p oPmDXx0UfZvYE53PT9d8gDOfCSaOZZfL2UDdhx1D0d8+zt0LroI37CRgJxsQHmdGAwg7 Wf5suBo4iQZfaaFQ1mcvp96MS+zMyW1q6b2FgA3fdY8zsu5P0lP6UnjhWji7gL7EoZka nNbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=cGpW4EhXIatXeLfl5fsgVMh5RNSm7d4sTNUGMrfZ+vw=; b=JuK/xy3puqfALSYhACWRqwQbycdOTdJtZbsb7UX8gmrOFYs+YCf6nsM83ONjubEQ8z 9uxF68SDQswRbRJZIx8Ue4JN0G6YDFfJvng0T1RCjBjFMEN/wxNydplgaMSWriSw5b+S hpuApL1mqKQco6SRMxSf1NLyM12pioY5BnA2jwe3/hpvIxgjD+TVaLzAMYW03P6v/mKp 8mY2/zM38qn29HEoipiehuX9nT3glJSajkuXd5+a29J812QjqphUq+yyVthKH40Cxxi/ KQMfIw2QrsXpzLztUr7gMuE0HLwfmrAyouBwQgC6kPJ9t40sd/JKG4GWakZLUyBZBOAg 2xoQ== X-Gm-Message-State: ACgBeo00Z7F0Y88lAmdv3h/dZ9OKJndbVHQrcXTUJkDZrgH8JPXaLJW+ XsfzQK1QS/N9Gk1WZW7QnXqS6C3eSUe6peMnK4Q= X-Received: by 2002:a17:907:a40d:b0:733:17c1:a246 with SMTP id sg13-20020a170907a40d00b0073317c1a246mr2697676ejc.132.1660169697557; Wed, 10 Aug 2022 15:14:57 -0700 (PDT) MIME-Version: 1.0 References: <2277279.ElGaqSPkdT@n95hx1g2> In-Reply-To: <2277279.ElGaqSPkdT@n95hx1g2> From: Luiz Augusto von Dentz Date: Wed, 10 Aug 2022 15:14:46 -0700 Message-ID: Subject: Re: [newbie] How does automatic reconnection work To: Christian Eggers Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Christian, On Wed, Aug 10, 2022 at 3:09 AM Christian Eggers wrote: > > Many Bluetooth devices seem to have some kind of "reconnect behavior". For instance > an audio speaker reconnects automatically to a phone as soon as they are within an > appropriate distance. > > On the web, there are also many instructions how to troubleshoot problems related to > "automatic reconnect" ([1], [2], [3]). > > How is this feature actually implemented? What do I have to consider if I want to > automatically reconnect my product with the customers phone? > > In my concrete case, I create a BNEP connection from my product to the customers phone > (which acts as a NAP, Bluetooth Tethering has to be enabled on the phone). I would like > to automatically reestablish the network connection as soon as the phone is within an > appropriate range. Auto connection is controllable via main.conf: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/main.conf#n263 That said that is not enabled for BNEP profiles by default, it is kind weird thing actually given that phones in general don't have Bluetooth tethering enabled all the time, in fact I believe the normal behavior is to disable tethering when disconnected, so even if you managed to reconnect it may not be tethering. > regards > Christian > > > [1] https://techwiser.com/fix-bluetooth-device-doesnt-auto-connect-in-linux/ > [2] https://unix.stackexchange.com/questions/334386/how-to-set-up-automatic-connection-of-bluetooth-headset > [3] https://stackoverflow.com/questions/32288670/bluez-auto-reconnect-devices > > > -- Luiz Augusto von Dentz