Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6606643ybn; Mon, 30 Sep 2019 00:21:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsohiKFOeJDW2bMXv/2ctkBFnw8Zm48xIweC15XrD0TgzRQa718FPBucs2CTLkwH8zR358 X-Received: by 2002:a17:906:f08:: with SMTP id z8mr18279617eji.18.1569828084005; Mon, 30 Sep 2019 00:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569828083; cv=none; d=google.com; s=arc-20160816; b=DXmYc1dgBQyttTlsLIddFrYL7h++aGlwXvJ08wPpxbDyFI/JUB9CvAvyehle1Pnq69 YKMNEybbJg0ud1AdYrHSxDX4gTdwIzbooAaP5T9LcsxUs0JJvQiyWt308W/d9I0FKMaA ZWy4IcUfXXyHHBbWKQWi4268IfuDgXf2eIUJVabFjryGjAMR3k3k2p6kwd27U+SHt/Ua aauy7nLl0Iltfk0r+0gkWgMiNiZWlxsHPkoFfHXJn7JbE1L8IYqFAz8uGRcnCMmGpVIA OqXKDO8MP6vtb3puL+tZpC1STpH+VnYB4knejPvZ4/OCbSvhD1r3zjoZ/5Pxfuy1jVxR TkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=rYAWPI3+FlriByB8hDT1uX4JyeJ2IPx16AmGX8G1sRo=; b=As5oKjdCNvGrHaOM/SRftJhxsF0hSJTuXj3hq2+Cku5+2OyQRAqiQUWnkt3oJrXGi4 41hMAz0X9EOMRys7m17IHq/XDqTMT9WhveQsjegMyOdNVAUtDk47jXnLjtHK/SpSmY/F RVfyK11zBP9Ia0BKU4MhuISIzsPtR8+m6QwVFqBW88RiZgsIxN6a94+dfAJJkzAtufJx HGQrpOhb/FaUTR7qYX9Ubh9ZtTvzhOyi0aceiZ19ans98krEZyqynsjGdnnTx21AdGGB +nCLlcsHig+aBj3gkT9VcayAKz9v3LOuM8J4mdo7/p/mVfStHgdmcWfdNj7b5HlviWaR FihQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=TSuUwLMZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sb7si6259326ejb.321.2019.09.30.00.20.45; Mon, 30 Sep 2019 00:21:23 -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=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=TSuUwLMZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbfI3HSJ (ORCPT + 99 others); Mon, 30 Sep 2019 03:18:09 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:39471 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfI3HSJ (ORCPT ); Mon, 30 Sep 2019 03:18:09 -0400 Received: by mail-wm1-f51.google.com with SMTP id v17so11409315wml.4 for ; Mon, 30 Sep 2019 00:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=rYAWPI3+FlriByB8hDT1uX4JyeJ2IPx16AmGX8G1sRo=; b=TSuUwLMZ73+OXWTHGl/K6LRojTFmEF+BACZqAIiLknZIpsYKRSpne8GBW5m4slKkK5 IjyVtnskbPA2OPC0+G2tu/d7s/xFqGLofTCM9zUnQ84BYEGUWBpCjmtDB7AiH9RdXiSI I4AQis3n6EpAbmDzKUx+TUPINXyagcAzfXq0gjmRG3LRHezQEze0bPiQyRwiN2mOxSHB sYhv1r3LXSWBXFEv/qiKczjzSPokrsul3kqioRt/F+Ngmp2tDnSfcN9tu6bDSU4yv7Fk JlTtA/6QXLznCTDs22ditWg5DU+O7KcomqTgaQPz97X5Z3+W2LE+/1ICPW7pFwwZXENX viAw== 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:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=rYAWPI3+FlriByB8hDT1uX4JyeJ2IPx16AmGX8G1sRo=; b=J1aqD1HsfoV2QjoCVsj5xl61mt7aMXu9U7BMfk7/9xBEyfHrtlBpAdpu4FnrZPuxj2 OZ0nvfnjUpBZE/5T5q7HF3/ra17K4K5+Lij9Jz+1KFFLWX/1FFrKYXpTFZpkl4+kchYa d5S+8Niclz+7+cceVxV4/EIx62oc2D4zu4gGEFs5ahqjHkfDKq6OV9IxxFKmrJ7OZV9/ LG1WK/nNrWN8PBNCarkjNj3LSyBHl5M+Qg9dYBKQ1ILrCFGcbJFDSUUXzfiPnIzyE3Ow wg15n7tmuazzL70fjk493cztLjFR9PozRKY1fB8mjSmPkTH++SaoUIxh3e92nclSvWXM kRoQ== X-Gm-Message-State: APjAAAU8TY81xeDifYY3MzCBzTuLGOz7N5/SHcp+LZLf65EdBwIXXrPg fMmoKR31QLJOgGQqqgznconREQ== X-Received: by 2002:a7b:cb08:: with SMTP id u8mr16886056wmj.6.1569827886245; Mon, 30 Sep 2019 00:18:06 -0700 (PDT) Received: from mlowasrzechonek2133 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id u83sm27846957wme.0.2019.09.30.00.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2019 00:18:05 -0700 (PDT) Date: Mon, 30 Sep 2019 09:18:03 +0200 From: "michal.lowas-rzechonek@silvair.com" To: "Gix, Brian" Cc: "Stotland, Inga" , "linux-bluetooth@vger.kernel.org" Subject: Re: mesh: org.bluez.mesh.Element.MessageReceived method does not provide destination address Message-ID: <20190930071803.nvp3ema26ynuiwz3@mlowasrzechonek2133> Mail-Followup-To: "Gix, Brian" , "Stotland, Inga" , "linux-bluetooth@vger.kernel.org" References: <20190830184301.zd3zaqrw7mv6r252@kynes> <20190918085239.xhahxoeqjkcrk3bl@mlowasrzechonek2133> <3c5858c94b3e08a61c5ff8493f9b00f5f77d0aac.camel@intel.com> <4b57242b15ccb44ac123858ce7bdf6e0e526b3e0.camel@intel.com> <20190927085208.sxy2x5656ci3opo6@mlowasrzechonek2133> <01c84f55db98fbcc2790d11fd6090589881c36cf.camel@intel.com> <856d4e6bfdbe84b7b7ac3742ebede263c7801346.camel@intel.com> <86e707237937cfb5c4e8fea8e96924f4590ab0a3.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86e707237937cfb5c4e8fea8e96924f4590ab0a3.camel@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Brian, Inga, On 09/27, Gix, Brian wrote: > > For a single MessageReceived() method, the cleanest way is to have the > > subscription address parameter as a variant (suggested by Michal) or as > > a dictionary. > > An array introduces an extra consideration of byte ordering for group > > addresses. > > If variants are easy to sort in scripting languages like python3, than I > suppose I could live with this. Last time I checked, it was C that had issues with any type of 'dynamic' typing, so I wouldn't worry about client languages. Handling D-Bus variants in python is trivial. > Or is this still a two step process of: > 1. Determining the u16 vs u128 > 1.1 unmarshalling the correct type... > > What would the signature of the method look like? Something like this: void MessageReceived(uint16 source, uint16 key_index, variant destination, array{byte} data) and on the Python side, the handling would look somewhat like this (since Python doesn't do overloading, at all): class ElementInterface: def MessageReceived(source, key_index, destination, data): if type(destination) == dbus.types.UINT16: group_destination = destination elif type(destination) == dbus.types.ARRAY: virtual_destination = uuid.UUID(destination) else: raise DBusError('Unrecoenized destination type') > > What I mostly about is that the represenation of the subscription > > address in the MessageReceived() method corresponds to the > > representation in the configuration dictionaries for the Attach() and > > UpdateModelConfiguration() methods. Agreed. regards -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND