Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1072512ybb; Wed, 1 Apr 2020 15:15:12 -0700 (PDT) X-Google-Smtp-Source: APiQypLLIeMDBQJlx94KzGe3XRXw6dNQ6xCiz15cFKfWczxIHZS8ACffBE9wTHFKY4vh9bJPMR3n X-Received: by 2002:aca:5403:: with SMTP id i3mr129320oib.174.1585779311958; Wed, 01 Apr 2020 15:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585779311; cv=none; d=google.com; s=arc-20160816; b=DDAhet8zdi6rgZGCh5qr6GUiZsETWZ1BBsgNsciwKn3VQct+KvvEbT9XFCHg6AchzN FnKKGWoc2RDYz0dMpBslX4mgHzCtvGJdvUZa0+rbyxNk/gD7BB9XDaVQOdvhjpavyMXG T6QSfXS0lcFdvn0tTMQ7UZPoZRxwMF0Ov2k7Ks7RsPIpgCV8Ygb+GZzuspMpswoFdroI uqT5VVputEO0y/hEsEJ0iffi/vMjzpzANMXvpfbl7x0/30xSLJp3Qf1hjkEvvU5kWrl7 LliW2u+IIAsyp7i/g61Xr//Flkk7y81l3plVy5AriFhm2Hzat4i/Fm1m0R8ysFmLogAJ G4rw== 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:date:subject:cc:to:from:dkim-signature; bh=6JWLeu2ewrcSvh4PqznXWmXhhzRoB0+IxpZ8RyL6tFc=; b=jbujuEDcl+o0OWDUFf9U6Js78qw4g5BU1RZ6IkpxEu3QPE9x9UtT4tSQ0bLh8BpirW 3r65UcA5QkwPOEX7Dzz0Q6sgWP+tp5q9z1SorqQdg2mLK7XH/OVCoB0ZvM2FcxpCVJTf wU8u6VsRJ2eXz/iEx6vej3/XUBfZnj5aeEwbjdPNUZ70/SOQeY6zLAuX3RVV2RLdN48W 69VOi/nWDCG4XghGsQK74jqc1NkaUDFnqmZSTCy9TzxtfjNg6BHhSgLn0qJ88eBXmnJo EDyYJwiojrkrGfe7Py5utXeBej2HkUFIryqUJufWNFPrT1G6eVM/XQVvWtUteh4+ys3Z kewA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Jd43wBMz; 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 y64si1501634oiy.12.2020.04.01.15.14.59; Wed, 01 Apr 2020 15:15:11 -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=Jd43wBMz; 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 S1732560AbgDAWOp (ORCPT + 99 others); Wed, 1 Apr 2020 18:14:45 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36236 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732385AbgDAWOo (ORCPT ); Wed, 1 Apr 2020 18:14:44 -0400 Received: by mail-pl1-f195.google.com with SMTP id g2so544705plo.3 for ; Wed, 01 Apr 2020 15:14:42 -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:mime-version :content-transfer-encoding; bh=6JWLeu2ewrcSvh4PqznXWmXhhzRoB0+IxpZ8RyL6tFc=; b=Jd43wBMz9NnsFai2iNyUpJEL6+DvooaCLotABtQeR7urSv5AFblQgjF0/+yC5ECRpT o4wVe1Q5/2Maym0ryNj2bYwEExS1qxfCUqPpfdmBsqPoiu+JqaSMy4In4zD2UJrPsXlB 2RPSp02ZKzTTrIlZi++BkCRxJpSOyayZSMH2Y= 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:mime-version :content-transfer-encoding; bh=6JWLeu2ewrcSvh4PqznXWmXhhzRoB0+IxpZ8RyL6tFc=; b=Xg67An6WchFTEOHRgzcdgIeeDqc8lCaKgCexmyjhR0Ee6JFwS5KSlrYRD2GwOryhLB roGJtYpDO5eKphN5hN7UUlhd8u3u4nxyRvRkGULXJ1c2wbjF2eUjnPQQKeeu8x0v5F/X DDm/5KNFGu2ZhHYERZk7hSC/J0b1VBWaPQ8VU34q667Hh4BsVpqjQ+suWnyigxR0EDDy zxBjE3WgJBdBrILvAYhWClg4G6nKK+Zypo7KaYWrCW5zYze9kWerh7LragQJdp//osTF gljf9INf1Q3Ht859C5TcgwZYVJpv5JmMqan5epg4N+nf6tt4UztneThOfkVK8Tu1DM3I ZhXg== X-Gm-Message-State: AGi0PuYBkpHSBmMRFCg1gHyzyRyehwzoRQPQVTmR+Hji1T2ZVUP2JqHZ kq9kKVonRrndyBEfCTbCCDssgI4Aq2A= X-Received: by 2002:a17:902:7244:: with SMTP id c4mr51605pll.88.1585779281797; Wed, 01 Apr 2020 15:14:41 -0700 (PDT) Received: from sonnysasaka-chrome.mtv.corp.google.com ([2620:15c:202:201:b7e2:9910:bd78:608d]) by smtp.gmail.com with ESMTPSA id z6sm2394666pjt.42.2020.04.01.15.14.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2020 15:14:41 -0700 (PDT) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Rahul Chaturvedi Subject: [PATCH 1/5] D-Bus API changes for managing SDP records Date: Wed, 1 Apr 2020 15:14:30 -0700 Message-Id: <20200401221434.12185-1-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Rahul Chaturvedi This defines the DBus API that we'll use with BlueZ to create, remove and get service records. --- doc/adapter-api.txt | 46 +++++++++++++++++++++++++++++++++++++++++++++ doc/device-api.txt | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt index acae032d9..6e4c37fc9 100644 --- a/doc/adapter-api.txt +++ b/doc/adapter-api.txt @@ -204,6 +204,52 @@ Methods void StartDiscovery() org.bluez.Error.NotReady org.bluez.Error.Failed + uint32 CreateServiceRecord(dict record) + + This method creates an entry with the local SDP server + for this adapter for the specified record. This method + will only create the SDP record and not start listening + on any ports. It is up to the caller of the method to + ensure the validity of the service record. This record + will not be parsed for any validation but will instead + directly be inserted into the local SDP server’s + records. + + The return value from this method will be the 32 bit + handle for the created service record. + + The record dictionary will have dictionary entries of + the format: {id : (type, size, value)}, where, + + uint16 id: The 16 bit attribute ID for an + attribute. + uint8 type: This will contain the type of the + attribute value. Attribute type values + are defined in the Bluetooth spec in + Volume 3, Part B, 3.2. + uint32 size: This is the size of the attribute + value. + variant value: This will contain the attribute value + for a given attribute_id. This variant + can either contain a primitive type, or + if type is SEQUENCE, an array of struct + of the signature (type, size, value). + + Possible errors: org.bluez.Error.NotReady + org.bluez.Error.AlreadyExists + org.bluez.Error.Failed + org.bluez.Error.InvalidArguments + + void RemoveServiceRecord(uint32 handle) + + This method removes the SDP record with the given + handle from the local SDP server. + + Possible errors: org.bluez.Error.NotReady + org.bluez.Error.DoesNotExist + org.bluez.Error.Failed + org.bluez.Error.InvalidArguments + Properties string Address [readonly] The Bluetooth device address. diff --git a/doc/device-api.txt b/doc/device-api.txt index ceb68d2f6..e8f2c670d 100644 --- a/doc/device-api.txt +++ b/doc/device-api.txt @@ -120,6 +120,43 @@ Methods void Connect() Possible errors: org.bluez.Error.DoesNotExist org.bluez.Error.Failed + array{array{dict}} GetServiceRecords() + + This method returns the complete service records of all + discovered BR/EDR services of the connected device till + now. The return value will be an array of an array of + dictionary entries. Each nested array of dictionary + entries will contain one service record. Each pair in + the returned dictionary entries will represent an + attribute in the service record. + + The dictionary entries in the returned array of entries + will be of the format: {id : (type, size, value)} where, + + uint16 id: The 16 bit attribute ID for an + attribute. + uint8 type: This will contain the type of the + attribute value. Attribute type values + are defined in the Bluetooth spec in + Volume 3, Part B, 3.2. + uint32 size: This is the size of the attribute + value. + variant value: This will contain the attribute value + for a given attribute_id. This variant + can either contain a primitive type, or + if type is SEQUENCE, an array of struct + of the signature (type, size, value). + + Since the service record contains the service UUID and + name, these fields do not need to be given separately. + This method should be called after the ServiceResolved + property for this object has been set to true otherwise + it may return a partial or stale cached list. + + Possible errors: org.bluez.Error.NotReady + org.bluez.Error.NotConnected + org.bluez.Error.Failed + Properties string Address [readonly] The Bluetooth device address of the remote device. -- 2.24.1