From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B15ABC76195 for ; Thu, 18 Jul 2019 08:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77E1D2173B for ; Thu, 18 Jul 2019 08:26:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EDJmPFYG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbfGRI0N (ORCPT ); Thu, 18 Jul 2019 04:26:13 -0400 Received: from mail-ot1-f47.google.com ([209.85.210.47]:46001 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbfGRI0M (ORCPT ); Thu, 18 Jul 2019 04:26:12 -0400 Received: by mail-ot1-f47.google.com with SMTP id x21so28071691otq.12 for ; Thu, 18 Jul 2019 01:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GkaprJuHG8aMYxCDCO7BOhlrd3nfkIcptm8XijDLzqo=; b=EDJmPFYG8iFYwHU/i6fpQasB4nt15GxCZy3YwN9/qDNKvrnVLQWzz7JzqTXiH6Ojcl FnZeugC+SUBeOoKfkr1Yf1DyRgwqMoajelXylPpxn3ahP9LpXVqJ/SknILnarkFqqBjg yVvrvdftzPRuzn56fP/m8x6Efa5dieNf032sZfHGFKZ2xF9z5Oo1w+k/TF5eGFFVih3O HUA27juuzCbHbgKJzhrFx3xRBsuxQYOckaXgmm980Cx3czA89FR2FOHq2dBCc4lzLXhR vey7YDMsqByMEaayYpzcSqiefdWn0RHfprFH9qH66YDOzRWNUpgYPRocCMEW43E+wExb m4jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GkaprJuHG8aMYxCDCO7BOhlrd3nfkIcptm8XijDLzqo=; b=HCurFhLFBF0NALLn7OUVHHHEbD0VmjqjqwVc+2z+8OVt9blLMy5cK4BSuDn//TCn1D xxOE9TvpXo3Z6lfkVewVCz3UnA8WfhrcHFc9XHGkm0RzSp/g3CFAUbvfLVZyhgkP76BQ k+WrTA60lM1F6HYzMOEZQeAhhSCa1bim0SWdq+3ZN1z2WA5pNpwE/6tMVog+jqns2bf8 qOWILN6mjpH84ydQZqJnzJCPKTVJPJ7RHwNw7rLIgE/GXhO9textrqk0nqbCatSsXLC9 o9pJsTFbQDuPtZt1AJDXkRCh0rKnVnw/Q+Ggq1jW8fsPIXTkKwo+9rExcMNnzlvqpMbd aM0A== X-Gm-Message-State: APjAAAXiV0R34rwf5kitQAXyQO4C3ZF8/3wl59LZFqwyTHzJJE+nvzFs cQj1FjbfKq323+zP83v/MxAoQVTwoNoxvyIDwlk= X-Google-Smtp-Source: APXvYqxhxnfBBW06tDS5sRucKcW8icgmoe7pPeOLzr0+QDM+lmsyIBCrDw2Fv6X8LZKwM2SuhVcZ/CNOVEDG3zpYjTM= X-Received: by 2002:a9d:7e88:: with SMTP id m8mr31667038otp.177.1563438371262; Thu, 18 Jul 2019 01:26:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Luiz Augusto von Dentz Date: Thu, 18 Jul 2019 11:25:58 +0300 Message-ID: Subject: Re: DBus LEAdvertisement and Python To: Barry Byford <31baz66@gmail.com> Cc: Bluez mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Barry, On Thu, Jul 18, 2019 at 10:03 AM Barry Byford <31baz66@gmail.com> wrote: > > Hello, > > The Python examples provided in the test directory of the BlueZ > repository use the python-dbus library. Looking at the documentation > of that library it does start by raising concerns and offering > alternatives. I have been looking at some of the alternatives and am > having difficultly getting them to work with BlueZ. I have been > focusing on the org.bluez.LEAdvertisement1 interface. > > Looking at the documentation, it says the service, interface and > object details are: > Service org.bluez > Interface org.bluez.LEAdvertisement1 > Object path freely definable > > I am not being successful at publishing to the org.bluez service. It > is also not where the current examples publish to. > Looking at the GattProfile1 documentation, it has service and object > as application dependant. > Service > Interface org.bluez.GattProfile1 > Object path > Should the documentation of Service on LEAdvertisement1 be freely > definable also? Yep, the bus name is up to the application which usually don't register a friendly name if you try to register with 'org.bluez' it would probably conflict with the daemon itself so you wouldn't be able to register that name anyway. > I have created the LEAdvertisement1 interface so that it has an > ObjectManager and is introspectable. When I pass the object to > RegisterAdvertisement on the org.bluez.LEAdvertisingManager1 interface > it accepts it (does not give an error) but does not register the data > and I see no advertisement appear. Is there somewhere I can find a > more detailed description of what needs to be on the > org.bluez.LEAdvertisement1 interface that will work with > RegisterAdvertisement? Do you have the bluetoothd output when you register, I get the following when using bluetoothctl: bluetooth]# power on Changing power on succeeded [bluetooth]# advertise on [CHG] Controller B8:8A:60:D8:17:D7 SupportedInstances: 0x04 [CHG] Controller B8:8A:60:D8:17:D7 ActiveInstances: 0x01 Advertising object registered Tx Power: off Name: off Apperance: off Discoverable: off [bluetooth]# bluetoothd[6103]: src/advertising.c:client_create() Adding proxy for /org/bluez/advertising bluetoothd[6103]: src/advertising.c:register_advertisement() Registered advertisement at path /org/bluez/advertising bluetoothd[6103]: src/advertising.c:refresh_adv() Refreshing advertisement: /org/bluez/advertising bluetoothd[6103]: src/advertising.c:add_adv_callback() Advertisement registered: /org/bluez/advertising > For reference, I have put below what I am currently putting on the > org.bluez.LEAdvertisement1 interface. > > Thanks, > Barry > > > $ busctl call ukBaz.bluezero /ukBaz/bluezero/advertisement1 > org.freedesktop.DBus.ObjectManager GetManagedObjects > a{oa{sa{sv}}} 1 "/ukBaz/bluezero/advertisement1" 5 > "org.freedesktop.DBus.Properties" 0 > "org.freedesktop.DBus.Introspectable" 0 "org.freedesktop.DBus.Peer" 0 > "org.freedesktop.DBus.ObjectManager" 0 "org.bluez.LEAdvertisement1" 6 > "Type" s "broadcast" "ServiceUUIDs" as 0 "ManufacturerData" a{sv} 0 > "SolicitUUIDs" as 0 "ServiceData" a{sv} 1 "FEAA" ay 18 16 8 3 117 107 > 66 97 122 46 103 105 116 104 117 98 46 105 111 "IncludeTxPower" b > false Not sure if that is the problem but usually ObjectManager is suppose to be on the '/' (root) path. > $ busctl call ukBaz.bluezero /ukBaz/bluezero/advertisement1 > org.freedesktop.DBus.Properties GetAll s org.bluez.LEAdvertisement1 > a{sv} 6 "Type" s "broadcast" "ServiceUUIDs" as 0 "ManufacturerData" > a{sv} 0 "SolicitUUIDs" as 0 "ServiceData" a{sv} 1 "FEAA" ay 18 16 8 3 > 117 107 66 97 122 46 103 105 116 104 117 98 46 105 111 > "IncludeTxPower" b false > > $ busctl call ukBaz.bluezero /ukBaz/bluezero/advertisement1 > org.freedesktop.DBus.Introspectable Introspect > s " Introspection 1.0//EN\"\n > \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n\n\n name=\"org.freedesktop.DBus.Properties\">\n \n > \n > \n type=\"v\" name=\"value\" direction=\"out\"/>\n \n > \n name=\"interface_name\" direction=\"in\"/>\n name=\"properties\" direction=\"out\"/>\n \n name=\"Set\">\n direction=\"in\"/>\n direction=\"in\"/>\n direction=\"in\"/>\n \n name=\"PropertiesChanged\">\n name=\"interface_name\"/>\n name=\"changed_properties\"/>\n name=\"invalidated_properties\"/>\n \n \n > \n name=\"Introspect\">\n direction=\"out\"/>\n \n \n name=\"org.freedesktop.DBus.Peer\">\n \n > \n name=\"machine_uuid\" direction=\"out\"/>\n \n > \n name=\"org.freedesktop.DBus.ObjectManager\">\n name=\"GetManagedObjects\">\n name=\"object_paths_interfaces_and_properties\" direction=\"out\">\n > \n \n \n > \n \n type=\"a{sa{sv}}\" name=\"interfaces_and_properties\">\n \n > \n \n type=\"o\" name=\"object_path\">\n \n name=\"interfaces\">\n \n \n \n > \n name=\"org.freedesktop.DBus.Properties.PropertiesChanged\" > value=\"const\">\n \n \n > value=\"true\">\n \n \n type=\"s\" name=\"Type\" access=\"read\">\n \n > \n > \n access=\"read\">\n \n name=\"SolicitUUIDs\" access=\"read\">\n \n type=\"a{sv}\" name=\"ServiceData\" access=\"read\">\n > \n access=\"read\">\n \n \n\n" -- Luiz Augusto von Dentz