Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp605271ybb; Fri, 3 Apr 2020 08:34:33 -0700 (PDT) X-Google-Smtp-Source: APiQypL7SRdMpnNvR1ixjlkvHHpTSrB05MtNxvIgnR+Qj0TPOBlR2yGgJzX6NddcCNcNbZLCtX5U X-Received: by 2002:a9d:6c19:: with SMTP id f25mr7028489otq.371.1585928073587; Fri, 03 Apr 2020 08:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585928073; cv=none; d=google.com; s=arc-20160816; b=gnYaaCRjqFEHyNIwao/VT+dQ4T9xwYUK7yIwOZO/9ULJmtr4WQb6MwpIgDLMVe/pPO wbbOQ5tM/D+CoT1TdyIQRwj6GBCVYFO7pRhLA5t9D6ExBqR70/SrIQMSfkvC7ILRTGt3 mCG8DD0Tx0A/3Ci4QVzjKv76rs5ZWFcE/iAhcG9yHbD5kSripk++GVaZjsHEu5R9nbNG PcoWEFoxkq5ef/IE91QdCY4eHMbmaR0TavMQJf5yK6wR8gtzk2yVIn6EamqP1qelk5o5 n2696zvv02bSu/jCDavxPvfqBMsgggErg3MXmMbCyIf1IAwYzujnKmri9zEvUlJz1fSl 6UiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hNj1HvQcoQUIk/hf7H2ea/gOxstvKpsPPqgiR8s/sQc=; b=X6Qk8l4mAZd/wkZ6bNL25lp8y2HWe1CQSRS5Avlb/+Q0KQWlShZIQ89OvDSReYQbt8 fDNVybYVUaUIqKsATlwZo/md+xH77Oq/bbTtVJBe/TCWCsZkdnCulLhr0wxeCr1Wfava esBM8kNy3KQZA5JIfrTUSxe8mkYn9jWMuG/4J+ZIoQcX8YJjdnjuCXDEEtyxpwETfnZO O+dKQdseXXa0soSOf1KUz0n9e4usdCMv1tu2u+UjwIck/MZiFhLASuWhKtOMVytTB1jk KUkXO1OO2s9mJFuU7guS1IoLy7AznlJtGAr4jzrXGKUEuEQ7vIStaMvQPtcrTPvKMAAe IEtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lzki3dhF; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si5124429ots.150.2020.04.03.08.34.13; Fri, 03 Apr 2020 08:34:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lzki3dhF; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404287AbgDCPd7 (ORCPT + 99 others); Fri, 3 Apr 2020 11:33:59 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:35073 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404286AbgDCPd7 (ORCPT ); Fri, 3 Apr 2020 11:33:59 -0400 Received: by mail-vs1-f66.google.com with SMTP id u11so5200054vsg.2 for ; Fri, 03 Apr 2020 08:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hNj1HvQcoQUIk/hf7H2ea/gOxstvKpsPPqgiR8s/sQc=; b=lzki3dhFN1Sv4r5Bt3bj8bZDRQNeZcadwqqv2fRsotNsyrCY2rAV62CN4wa7Uk/c91 5BUE8VVK3o5eaceMnhepKiCtwr+0Cj4zircND8GZxbR3GFMzF0DNbfKqDcFfONKQG0VT 8oVgkewXCBnqwmvfJb5ZB+Z/IcKUtxq0Os0AI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hNj1HvQcoQUIk/hf7H2ea/gOxstvKpsPPqgiR8s/sQc=; b=VQxQU9hJI3eeqk5GGuwM38NDhYqRpyjyBhibg/Rhc3HwvB4XB8F+EwhRxs2qfSebvh IXoA7p43bnSapipIE0FeYEnKZd9yE92aP1hsqPorSHRU26odAJNYM3oWRizAOMnIRIsf JXVVlJwddB62KWatOQDfEu98jjH4VwPJY/H58VkAzhbywPCKtQ1oT+CsusQJgWM825vx eFp3iZ2T/m5SXEY1abVY7pQKiKC7edwmKwgPIAwK8acn1I25kcwK1TaraCap74WkN5xS UVYFIJbcimhYK1gqjtiPGQOCduOlVDbbyCrTSRD3IDIFedrLarJQEKXdnV67wFC/sDoK 58KA== X-Gm-Message-State: AGi0PuZVFgdE9MkrQQo3NdKvQYf6yX8tw38kfC82YtqENxb5EgsxpuET iru4AEwpDTIQlct08YsMhUO2+YTbMl8= X-Received: by 2002:a67:d60d:: with SMTP id n13mr7379125vsj.230.1585928038056; Fri, 03 Apr 2020 08:33:58 -0700 (PDT) Received: from alain.c.googlers.com.com (57.152.190.35.bc.googleusercontent.com. [35.190.152.57]) by smtp.gmail.com with ESMTPSA id u82sm2145510vsu.20.2020.04.03.08.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 08:33:57 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [Bluez PATCH v1 2/2] adapter:Enable wideband_speech if supported Date: Fri, 3 Apr 2020 15:33:32 +0000 Message-Id: <20200403153331.101846-2-alainm@chromium.org> X-Mailer: git-send-email 2.26.0.292.g33ef6b2f38-goog In-Reply-To: <20200403153331.101846-1-alainm@chromium.org> References: <20200403153331.101846-1-alainm@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This change will enable the MGMT_SETTING_WIDEBAND_SPEECH setting and implement the adapter property to allow higher level profile implementations to know if the adapter supports and has the feature enabled. --- src/adapter.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 972d88772..02c5f7e1c 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3424,6 +3424,15 @@ static DBusMessage *connect_device(DBusConnection *conn, return NULL; } +static gboolean property_get_wideband_speech_enabled( + const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + struct btd_adapter *adapter = user_data; + + return property_get_mode(adapter, MGMT_SETTING_WIDEBAND_SPEECH, iter); +} + static const GDBusMethodTable adapter_methods[] = { { GDBUS_ASYNC_METHOD("StartDiscovery", NULL, NULL, start_discovery) }, { GDBUS_METHOD("SetDiscoveryFilter", @@ -3459,6 +3468,7 @@ static const GDBusPropertyTable adapter_properties[] = { { "UUIDs", "as", property_get_uuids }, { "Modalias", "s", property_get_modalias, NULL, property_exists_modalias }, + { "WidebandSpeechEnabled", "b", property_get_wideband_speech_enabled }, { } }; @@ -8808,6 +8818,8 @@ static void read_info_complete(uint8_t status, uint16_t length, set_mode(adapter, MGMT_OP_SET_LE, 0x01); if (missing_settings & MGMT_SETTING_BREDR) set_mode(adapter, MGMT_OP_SET_BREDR, 0x01); + if (missing_settings & MGMT_SETTING_WIDEBAND_SPEECH) + set_mode(adapter, MGMT_OP_SET_WIDEBAND_SPEECH, 0x01); break; case BT_MODE_BREDR: if (!(adapter->supported_settings & MGMT_SETTING_BREDR)) { @@ -8822,6 +8834,8 @@ static void read_info_complete(uint8_t status, uint16_t length, set_mode(adapter, MGMT_OP_SET_BREDR, 0x01); if (adapter->current_settings & MGMT_SETTING_LE) set_mode(adapter, MGMT_OP_SET_LE, 0x00); + if (missing_settings & MGMT_SETTING_WIDEBAND_SPEECH) + set_mode(adapter, MGMT_OP_SET_WIDEBAND_SPEECH, 0x01); break; case BT_MODE_LE: if (!(adapter->supported_settings & MGMT_SETTING_LE)) { -- 2.26.0.292.g33ef6b2f38-goog