All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inga Stotland <inga.stotland@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: brian.gix@intel.com, Inga Stotland <inga.stotland@intel.com>
Subject: [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method
Date: Mon, 17 Feb 2020 23:52:08 -0800	[thread overview]
Message-ID: <20200218075208.17135-1-inga.stotland@intel.com> (raw)

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


             reply	other threads:[~2020-02-18  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18  7:52 Inga Stotland [this message]
2020-02-19  2:19 ` [PATCH BlueZ] test/test-mesh: Fix output of MessageReceived method Gix, Brian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200218075208.17135-1-inga.stotland@intel.com \
    --to=inga.stotland@intel.com \
    --cc=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.