All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method
@ 2020-02-18  7:52 Inga Stotland
  2020-02-19  2:19 ` Gix, Brian
  0 siblings, 1 reply; 2+ messages in thread
From: Inga Stotland @ 2020-02-18  7:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: brian.gix, Inga Stotland

This fixes formatted output of recieved message parameters.
---
 test/test-mesh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/test-mesh b/test/test-mesh
index 5777fcebc..929e28fd3 100755
--- a/test/test-mesh
+++ b/test/test-mesh
@@ -559,8 +559,15 @@ class Element(dbus.service.Object):
 	@dbus.service.method(MESH_ELEMENT_IFACE,
 					in_signature="qqvay", out_signature="")
 	def MessageReceived(self, source, key, destination, data):
-		print('Message Received on Element %d, src=%04x, dst=%s' %
-						self.index, source, destination)
+		print(('Message Received on Element %02x') % self.index, end='')
+		print(', src=', format(source, '04x'), end='')
+
+		if isinstance(destination, int):
+			print(', dst=%04x' % destination)
+		elif isinstance(destination, dbus.Array):
+			dst_str = array_to_string(destination)
+			print(', dst=' + dst_str)
+
 		for model in self.models:
 			model.process_message(source, key, data)
 
-- 
2.21.1


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

* Re: [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method
  2020-02-18  7:52 [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method Inga Stotland
@ 2020-02-19  2:19 ` Gix, Brian
  0 siblings, 0 replies; 2+ messages in thread
From: Gix, Brian @ 2020-02-19  2:19 UTC (permalink / raw)
  To: linux-bluetooth, Stotland, Inga

Applied
On Mon, 2020-02-17 at 23:52 -0800, Inga Stotland wrote:
> This fixes formatted output of recieved message parameters.
> ---
>  test/test-mesh | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/test/test-mesh b/test/test-mesh
> index 5777fcebc..929e28fd3 100755
> --- a/test/test-mesh
> +++ b/test/test-mesh
> @@ -559,8 +559,15 @@ class Element(dbus.service.Object):
>  	@dbus.service.method(MESH_ELEMENT_IFACE,
>  					in_signature="qqvay", out_signature="")
>  	def MessageReceived(self, source, key, destination, data):
> -		print('Message Received on Element %d, src=%04x, dst=%s' %
> -						self.index, source, destination)
> +		print(('Message Received on Element %02x') % self.index, end='')
> +		print(', src=', format(source, '04x'), end='')
> +
> +		if isinstance(destination, int):
> +			print(', dst=%04x' % destination)
> +		elif isinstance(destination, dbus.Array):
> +			dst_str = array_to_string(destination)
> +			print(', dst=' + dst_str)
> +
>  		for model in self.models:
>  			model.process_message(source, key, data)
>  

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

end of thread, other threads:[~2020-02-19  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18  7:52 [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method Inga Stotland
2020-02-19  2:19 ` Gix, Brian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.