Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH BlueZ] test/test-mesh: Initialize required properties
@ 2019-07-25 18:31 Inga Stotland
  2019-07-26 16:20 ` Gix, Brian
  0 siblings, 1 reply; 2+ messages in thread
From: Inga Stotland @ 2019-07-25 18:31 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, Inga Stotland

This initialized required "Models" and "VendorModels" properties
wheher the actual models exist or not, according to the mesh-api.txt.
In case when an element does not contain either SIG defined models or
vendor defineed models, the corresponding properties should contain
empty arrays.
---
 test/test-mesh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/test/test-mesh b/test/test-mesh
index 6e9196366..3c5ded7b3 100755
--- a/test/test-mesh
+++ b/test/test-mesh
@@ -537,10 +537,8 @@ class Element(dbus.service.Object):
 		sig_models = self._get_sig_models()
 
 		props = {'Index' : dbus.Byte(self.index)}
-		if len(sig_models) != 0:
-			props['Models'] = dbus.Array(sig_models, signature='q')
-		if len(vendor_models) != 0:
-			props['VendorModels'] = dbus.Array(vendor_models,
+		props['Models'] = dbus.Array(sig_models, signature='q')
+		props['VendorModels'] = dbus.Array(vendor_models,
 							signature='(qq)')
 		#print(props)
 		return { MESH_ELEMENT_IFACE: props }
-- 
2.21.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] test/test-mesh: Initialize required properties
  2019-07-25 18:31 [PATCH BlueZ] test/test-mesh: Initialize required properties Inga Stotland
@ 2019-07-26 16:20 ` Gix, Brian
  0 siblings, 0 replies; 2+ messages in thread
From: Gix, Brian @ 2019-07-26 16:20 UTC (permalink / raw)
  To: linux-bluetooth, Stotland, Inga

Applied

On Thu, 2019-07-25 at 11:31 -0700, Inga Stotland wrote:
> This initialized required "Models" and "VendorModels" properties
> wheher the actual models exist or not, according to the mesh-api.txt.
> In case when an element does not contain either SIG defined models or
> vendor defineed models, the corresponding properties should contain
> empty arrays.
> ---
>  test/test-mesh | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/test/test-mesh b/test/test-mesh
> index 6e9196366..3c5ded7b3 100755
> --- a/test/test-mesh
> +++ b/test/test-mesh
> @@ -537,10 +537,8 @@ class Element(dbus.service.Object):
>  		sig_models = self._get_sig_models()
>  
>  		props = {'Index' : dbus.Byte(self.index)}
> -		if len(sig_models) != 0:
> -			props['Models'] = dbus.Array(sig_models, signature='q')
> -		if len(vendor_models) != 0:
> -			props['VendorModels'] = dbus.Array(vendor_models,
> +		props['Models'] = dbus.Array(sig_models, signature='q')
> +		props['VendorModels'] = dbus.Array(vendor_models,
>  							signature='(qq)')
>  		#print(props)
>  		return { MESH_ELEMENT_IFACE: props }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 18:31 [PATCH BlueZ] test/test-mesh: Initialize required properties Inga Stotland
2019-07-26 16:20 ` Gix, Brian

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox