diff options
author | Inga Stotland <inga.stotland@intel.com> | 2020-02-17 23:52:08 -0800 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-02-18 09:36:56 -0800 |
commit | 5a75f9795801c027b51f46bf6fa33131e9e30402 (patch) | |
tree | 1681812d486fdfdf61047f4b74151eb429a69d37 /test | |
parent | 1524499483a3678951c0e3059b158836398c4e9b (diff) | |
download | bluez-5a75f9795801c027b51f46bf6fa33131e9e30402.tar.gz |
test/test-mesh: Fix output of MessageReceived method
This fixes formatted output of recieved message parameters.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-mesh | 11 |
1 files 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) |