Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1376835pxv; Fri, 23 Jul 2021 07:00:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw57h4er+kV7CTUcp9HBWBm/ZoVKmcKkFMeWBDYPTpJ5TPSRuKuJ2WqOlAo+xdT68X+8LBc X-Received: by 2002:a5e:8e02:: with SMTP id a2mr4003898ion.205.1627048827844; Fri, 23 Jul 2021 07:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627048827; cv=none; d=google.com; s=arc-20160816; b=pZI0iblhXOMp1VvhFKCORWl3one66Qae6g0HRf283dpRr1BjJvyGgaa88ptH/7v994 XiS97kyTxVtATDdxXmiBtHOnfqggB3YEViKCPAYKzxIIXPIvD16HEyDR6gquiQwcHNSJ yu/RRN97raN2S7PeTddGha+7i1r4ay8elNvxz0y3jTtars0MHmTb/2xIHIrfXY4rWQ1N eAYrSmzXiw8o3AF+13s+aVB8qZWSrFDmcIh0Xks9bu0PgR2QP3Nu013q+2LUYrWmeeM1 G4OEsjQVw3Vv2V9sDX1t7FDogTYNGHARQvS4XH1nd149UHc892ARcXVRKB+3slTAX9WY eLmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rqbpAGcd49pYp2w1BblwMuGhH6qZvIOz8MUBv68fiFI=; b=oPA2pLWSfB9Hxwq8IqxccsGNYWFLuQQ4y8u4GXXVNZ3VmHhkwC2KpBfdFMa6SeGTmu TpdUE4PHpfNMtdjbbPHQR74NWdG6/+MkQcyylVZV3+l1l3AhywkGdmMUPBN47QYQOEOs ffdZDhirpMm60Y5OfiZOt+/dVvUKGOD/s4qeeVhSDciiKMwOzYWgrxynYMUrn19/V/z+ sj952MvD6WR8UsjdnX+JAW8toJCYUJxVbSbX1YWAFmCXzo3Mr2EEX7qi86Vmo/x5hQ4Y 1dlXn89rXG5Q6yaX72D1MbWbbQ4rb6b/Kx/6kj8W2cUyb7Heiz7EKI4ekhqoKaX2n87k 5Oow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=XWOIHfK5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b39si23731495jav.0.2021.07.23.06.59.55; Fri, 23 Jul 2021 07:00:27 -0700 (PDT) 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=@dylanvanassche.be header.s=MBO0001 header.b=XWOIHfK5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbhGWNSZ (ORCPT + 99 others); Fri, 23 Jul 2021 09:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235311AbhGWNSY (ORCPT ); Fri, 23 Jul 2021 09:18:24 -0400 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7891AC061757 for ; Fri, 23 Jul 2021 06:58:58 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4GWWBm73sYzQjBM; Fri, 23 Jul 2021 15:58:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1627048735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rqbpAGcd49pYp2w1BblwMuGhH6qZvIOz8MUBv68fiFI=; b=XWOIHfK50ZuWtsUPtewXJcr2UiikzFGHrroXaeT/OvMP1bF3LBcvuQ1gFgGj/hpxwRCiBE bWWQQiPEEy9Ajw3Ate+jeCU/MASKWi5D7ARA6YOR26JeV9xyd/a7hBsMuAL60pZDGT/s/w b9oMzZs5wykf7PvdDOf5Qyb6TXAfvOdmox57nD4WKaO9DTJafgOe6Ioi1WxsgeVKqsNMhE K4YmI2UyL+VgrH45BzjOHRFiyTMc2Q2Mybh8gmIgM7PIHFXby0ZOZXHnKo6u2eFghFt8rl k9RsSkWAc8eNsK3P6WxHATfLqG9ooxWjxxrr25r9xYz0y0QpO3n3CXw133Mcug== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id SvvYvM_GF8Cv; Fri, 23 Jul 2021 15:58:54 +0200 (CEST) From: Dylan Van Assche To: linux-bluetooth@vger.kernel.org Cc: Hannu Mallat Subject: [PATCH BlueZ 4/4] obexd: phonebook: Set default apparams for PTS clients Date: Fri, 23 Jul 2021 15:58:24 +0200 Message-Id: <20210723135824.8032-5-me@dylanvanassche.be> In-Reply-To: <20210723135824.8032-1-me@dylanvanassche.be> References: <20210723135824.8032-1-me@dylanvanassche.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3976918C6 X-Rspamd-UID: d8e3da Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Hannu Mallat Some PTS clients do not send all the mandatory apparams when retrieving the phonebook. Clients such as car multimedia systems cannot be fixed, therefore working around this issue by inserting default apparams which makes these clients work as well. --- obexd/plugins/pbap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index efae92cd8..ab5236316 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -511,6 +511,21 @@ static int pbap_get(struct obex_session *os, void *user_data) rsize = 0; } + /* Workaround for PTS client not sending mandatory apparams */ + if (!rsize && g_ascii_strcasecmp(type, VCARDLISTING_TYPE) == 0) { + static const uint8_t default_apparams[] = { + 0x04, 0x02, 0xff, 0xff + }; + buffer = default_apparams; + rsize = sizeof(default_apparams); + } else if (!rsize && g_ascii_strcasecmp(type, VCARDENTRY_TYPE) == 0) { + static const uint8_t default_apparams[] = { + 0x07, 0x01, 0x00 + }; + buffer = default_apparams; + rsize = sizeof(default_apparams); + } + params = parse_aparam(buffer, rsize); if (params == NULL) return -EBADR; -- 2.32.0