[PATCH obexd 5/7 v2] test: Update pbap-client to work with changes in PhonebookAcess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

---
 test/pbap-client | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/test/pbap-client b/test/pbap-client
index 498f8a3..7dd54ef 100755
--- a/test/pbap-client
+++ b/test/pbap-client
@@ -70,16 +70,16 @@ class PbapClient:
 		print "Transfer finished with error %s: %s" % (code, message)
 		mainloop.quit()
 
-	def pull(self, vcard, func):
+	def pull(self, vcard, params, func):
 		req = Transfer(func)
-		self.pbap.Pull(vcard, "",
+		self.pbap.Pull(vcard, "", params,
 				reply_handler=lambda r: self.register(r, req),
 				error_handler=self.error)
 		self.transfers += 1
 
-	def pull_all(self, func):
+	def pull_all(self, params, func):
 		req = Transfer(func)
-		self.pbap.PullAll("",
+		self.pbap.PullAll("", params,
 				reply_handler=lambda r: self.register(r, req),
 				error_handler=self.error)
 		self.transfers += 1
@@ -135,18 +135,15 @@ if  __name__ == '__main__':
 		print "Size = %d\n" % (ret)
 
 		print "\n--- List vCard ---\n"
-		ret = pbap_client.interface().List()
+		ret = pbap_client.interface().List(dbus.Dictionary())
+		params = dbus.Dictionary({ "Format" : "vcard30",
+					"Fields" : [ "VERSION", "FN", "TEL"] })
 		for item in ret:
 			print "%s : %s" % (item[0], item[1])
-			pbap_client.interface().SetFormat("vcard30")
-			pbap_client.interface().SetFilter(["VERSION", "FN",
-								"TEL"]);
-			pbap_client.pull(item[0],
+			pbap_client.pull(item[0], params,
 					lambda x: process_result(x, None))
 
-		pbap_client.interface().SetFormat("vcard30")
-		pbap_client.interface().SetFilter(["VERSION", "FN", "TEL"]);
-		pbap_client.pull_all(lambda x: process_result(x,
+		pbap_client.pull_all(params, lambda x: process_result(x,
 							"\n--- PullAll ---\n"))
 
 		pbap_client.flush_transfers(lambda: test_paths(paths[1:]))
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux