Linux bluetooth development
 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 3/4] test/test-mesh: Update to match modified APIs
Date: Fri, 27 Mar 2020 11:42:56 -0700	[thread overview]
Message-ID: <20200327184257.15042-4-inga.stotland@intel.com> (raw)
In-Reply-To: <20200327184257.15042-1-inga.stotland@intel.com>

This handles updated parameter list in UnprovisionedScan(),
AddNode() and ScanResult() D-Bus methods
---
 test/test-mesh | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/test/test-mesh b/test/test-mesh
index 6a5ddbd17..5db1d6d1a 100755
--- a/test/test-mesh
+++ b/test/test-mesh
@@ -474,13 +474,22 @@ class Application(dbus.service.Object):
 	def JoinFailed(self, value):
 		print(set_error('JoinFailed '), value)
 
-	@dbus.service.method(MESH_PROV_IFACE,
-					in_signature="nay", out_signature="")
-	def ScanResult(self, rssi, uuid):
-		uuid_str = array_to_string(uuid)
-		print(set_yellow('ScanResult RSSI ')
-					+ set_green(format(rssi, 'd'))
-					+ ' ' + uuid_str)
+	@dbus.service.method(MESH_PROV_IFACE, in_signature="naya{sv}",
+							out_signature="")
+	def ScanResult(self, rssi, data, options):
+		global remote_uuid
+		remote_uuid = data[:16]
+		uuid_str = array_to_string(remote_uuid)
+		data_str = array_to_string(data[16:])
+		if len(data_str) == 0:
+			data_str = 'Not Present'
+
+		print(set_yellow('ScanResult >> RSSI: ') +
+					set_green(format(rssi, 'd')) +
+					set_yellow(format(' UUID: ')) +
+					set_green(format(uuid_str, 's')) +
+					set_yellow(format(' OOB Data: ')) +
+					set_green(format(data_str, 's')))
 
 	@dbus.service.method(MESH_PROV_IFACE,
 					in_signature="y", out_signature="qq")
@@ -946,8 +955,6 @@ class MainMenu(Menu):
 		uuid = bytearray.fromhex("0a0102030405060708090A0B0C0D0E0F")
 		random.shuffle(uuid)
 		uuid_str = array_to_string(uuid)
-		caps = ["out-numeric"]
-		oob = ["other"]
 
 		print(set_yellow('Joining with UUID ') + set_green(uuid_str))
 		mesh_net.Join(app.get_path(), uuid,
@@ -955,23 +962,27 @@ class MainMenu(Menu):
 			error_handler=join_error_cb)
 
 	def __cmd_scan(self):
+		options = {}
+		options['Seconds'] = dbus.UInt16(0)
 
 		print(set_yellow('Scanning...'))
-		node_mgr.UnprovisionedScan(0, reply_handler=add_cb,
-						error_handler=add_error_cb)
+		node_mgr.UnprovisionedScan(options,
+						reply_handler=scan_cb,
+						error_handler=scan_error_cb)
 
 	def __cmd_add(self):
 		global user_input
+		global remote_uuid
+
 		if agent == None:
 			print(set_error('Provisioning agent not found'))
 			return
 
 		uuid_str = array_to_string(remote_uuid)
-		caps = ["in-numeric"]
-		oob = ["other"]
+		options = {}
 
 		print(set_yellow('Adding dev UUID ') + set_green(uuid_str))
-		node_mgr.AddNode(remote_uuid, reply_handler=add_cb,
+		node_mgr.AddNode(remote_uuid, options, reply_handler=add_cb,
 						error_handler=add_error_cb)
 
 	def __cmd_attach(self):
-- 
2.21.1


  parent reply	other threads:[~2020-03-27 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 18:42 [PATCH BlueZ 0/4] API changes for forward compatibility Inga Stotland
2020-03-27 18:42 ` [PATCH BlueZ 1/4] doc/mesh-api: Forward compatibility modifications Inga Stotland
2020-03-27 18:42 ` [PATCH BlueZ 2/4] mesh: Update UnprovisionedScan, AddNode & ScanResult Inga Stotland
2020-03-27 21:17   ` Gix, Brian
2020-03-27 22:22     ` Stotland, Inga
2020-03-27 18:42 ` Inga Stotland [this message]
2020-03-27 18:42 ` [PATCH BlueZ 4/4] tools/mesh-cfgclient: Update to match modified APIs Inga Stotland
2020-03-30 22:07 ` [PATCH BlueZ 0/4] API changes for forward compatibility 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=20200327184257.15042-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox