Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2135510ybc; Sun, 17 Nov 2019 14:54:54 -0800 (PST) X-Google-Smtp-Source: APXvYqw/kVhxofh5VblalmXYd3566QIIrQOJ+KKCnxR5HKDD6xiBMVxWs3GtxDGqOz7UX5bR/Mim X-Received: by 2002:a17:906:32d3:: with SMTP id k19mr21637666ejk.75.1574031294062; Sun, 17 Nov 2019 14:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574031294; cv=none; d=google.com; s=arc-20160816; b=V5ex1aEb4lo7NRDPADsY3XYT7enOnWJufzcJw0a5/6+ZzsRBM+jl3WzLOlonsPbFse e6iDAOu2vu2lJnHGLJDo6qPNroGjcM+AHotubvzWmRG7YoTSSTVWiui75JBEbb9JRGZK TKQEz13s93lEUjPpQvox8NqdhFUS6wW6/E8HMSAHjfqI8Bc4nRmPYMf30TItCtUCP2Fw pn2pOEIyrBVBeJAvfIdHFAGQhoVtnxu2f53Dp3Z2sCrXawAuWkcISlNgkPVq67OyLCQb r3UORydgnpDzx/4AaIrYYwVCCTa4sg/YSI9vxqOAiSGh5KlS63AmzSbcoAyz8ZPkvAzS u4RQ== 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 :message-id:subject:to:from:date:dkim-signature; bh=ZooYqaZd0afWn2wcHg01anX+McZA6MwmgMAGR/Ya9gs=; b=Kpvxe/psRJQnV7ySj+ozwNU6AOLwMDCNKvC482Hw6aZgVwCNHP0V+HOnE+ZNXeLFc3 tjt96BCnzh1E+SE5MSt61o1qCrTug6WHc6wbjrC3oGHO/4QcdgUIDdPYmJoFpHKofAKG nbhbdf5W4jxI/r9p8IME8gS66Aft5UQUgf9fCzX7diwglWXB07D29tfJ7En/rNnaK2jv IZkcKUYFzf4s0JptnQEuokg5qLWXd+lmxjBVn8feNjU1wBYsSHLrrgZVsj8rAZLCq8ym muflC9Nrg9l3u/BZrx5tsGgchUBSBcOkcxsyUxO0iwADzAIvMWNQHu/0KoNtSL57GaFP r6HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ybtor7VY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si4189627edq.48.2019.11.17.14.54.08; Sun, 17 Nov 2019 14:54:54 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=Ybtor7VY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726271AbfKQWwq (ORCPT + 99 others); Sun, 17 Nov 2019 17:52:46 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45407 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfKQWwq (ORCPT ); Sun, 17 Nov 2019 17:52:46 -0500 Received: by mail-wr1-f68.google.com with SMTP id z10so17239993wrs.12 for ; Sun, 17 Nov 2019 14:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=ZooYqaZd0afWn2wcHg01anX+McZA6MwmgMAGR/Ya9gs=; b=Ybtor7VYCYTfSu/9UmbmRjpP/zOMeJxlf/DF1LmKFsRf35StN6fVPS2PkIwU4Gms/1 mp/ex+KEJ6tdhP/pr1buGJNBncx/qyxcpEzgNminH/hGAMUUe1AqDVI50PmgGVV2z4PN 28vPfFSpBhKILaAlfDU1UIIrae+Jfo7D8DdYVXoywyfZi/xwxJGeFrdKI1uyaKZuM5Sk xrGZhgEQjEUPAuT+8FIMCdnpsVcon26v8hMKTk6EQEdeWp1sg5KSq+iBYDSzQ0L46is/ UCQfX7gmiyvVlXRIF49Ej0k7KtPg8IgZ2lDCnUXiQHg8AOn3cP5/wfJy99h82NCU7GGF Fzfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=ZooYqaZd0afWn2wcHg01anX+McZA6MwmgMAGR/Ya9gs=; b=hs995xgG9X4W8nTdvYd0n9eUxZ4wtHPNQ812XXp5Hy6kYr5qclHukgHWcUQAyeBBhg hAUGFOrTIN6kkhUEyWEg19gpDjGHGMES4WjbmImBk/rqLoVoSVKtmqpcJZuEfiBahY1v UzgSCb84j70Rek2+WXkkg/BJ3LfJ7FIDADVFD8v5l32bnHwaMALnXoSHlfDcsKf6rRCU J9C2QKV8P9BXnZKII2h7pIqvwRsmltoDq/HXian3Z0/aEfbvnufdp96iWL3jr+7VNcR6 M3OzPlLv5I1MDc4frvUnRH7RoYB4/ycjqQgHwVWPbM28aUphAEQi7Bhx/4lMfNvz1rX1 G8yQ== X-Gm-Message-State: APjAAAWkmXfCrqAgHtTjWw59+2HffeRaUNPDEOgj8qG6C9n51M/J7Q5L itCvYE12a3JTAoVKg2o0t4q1+DTZ X-Received: by 2002:adf:9527:: with SMTP id 36mr26093281wrs.398.1574031162944; Sun, 17 Nov 2019 14:52:42 -0800 (PST) Received: from sambook (adtp124.neoplus.adsl.tpnet.pl. [79.185.227.124]) by smtp.gmail.com with ESMTPSA id t14sm20364429wrw.87.2019.11.17.14.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 14:52:42 -0800 (PST) Date: Sun, 17 Nov 2019 23:51:46 +0100 From: "Arkadiusz (Arkq) Bokowy" To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] profile: Default SDP settings for HSP Headset Message-ID: <20191117235146.633141f7@sambook> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add default SDP record for HSP Headset, so one can use this profile in a similar fashion to HFP Headset profile - no user configuration required. Without proper SDP record, connection with HSP Headset might not work properly. --- src/profile.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/profile.c b/src/profile.c index 192fd0245..821d09bff 100644 --- a/src/profile.c +++ b/src/profile.c @@ -56,6 +56,7 @@ #define DUN_DEFAULT_CHANNEL 1 #define SPP_DEFAULT_CHANNEL 3 +#define HSP_HS_DEFAULT_CHANNEL 6 #define HFP_HF_DEFAULT_CHANNEL 7 #define OPP_DEFAULT_CHANNEL 9 #define FTP_DEFAULT_CHANNEL 10 @@ -155,6 +156,43 @@ \ " +#define HSP_HS_RECORD \ + " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + " + #define HSP_AG_RECORD \ " \ \ @@ -1761,6 +1799,14 @@ static char *get_hfp_ag_record(struct ext_profile *ext, struct ext_io *l2cap, ext->name, ext->features); } +static char *get_hsp_hs_record(struct ext_profile *ext, struct ext_io *l2cap, + struct ext_io *rfcomm) +{ + const char *volume_control = ext->features ? "true" : "false"; + return g_strdup_printf(HSP_HS_RECORD, rfcomm->chan, ext->version, + ext->name, volume_control); +} + static char *get_hsp_ag_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { @@ -1993,6 +2039,16 @@ static struct default_settings { .auto_connect = true, .get_record = get_hsp_ag_record, .version = 0x0102, + }, { + .uuid = HSP_HS_UUID, + .name = "Headset unit", + .priority = BTD_PROFILE_PRIORITY_HIGH, + .remote_uuid = HSP_AG_UUID, + .channel = HSP_HS_DEFAULT_CHANNEL, + .authorize = true, + .auto_connect = true, + .get_record = get_hsp_hs_record, + .version = 0x0102, }, { .uuid = OBEX_OPP_UUID, .name = "Object Push", -- 2.23.0