From bf1299b6950a402d27f302f2f0531384d4834375 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 13 Nov 2012 10:25:03 +0200 Subject: [PATCH] test: Add HFP test case to test-profile --- test/test-profile | 59 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/test/test-profile b/test/test-profile index 46879d0df..5a3f9551c 100755 --- a/test/test-profile +++ b/test/test-profile @@ -11,6 +11,52 @@ import dbus.service import dbus.mainloop.glib from optparse import OptionParser, make_option +hfp_record = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +""" + class Profile(dbus.service.Object): @dbus.service.method("org.bluez.Profile1", in_signature="", out_signature="") @@ -63,7 +109,10 @@ if __name__ == '__main__': make_option("-P", "--PSM", action="store", type="int", dest="psm"), make_option("-C", "--channel", action="store", - type="int", dest="channel") + type="int", dest="channel"), + make_option("-r", "--record", action="store", + type="string", dest="record", + default=None), ] parser = OptionParser(option_list=option_list) @@ -74,6 +123,11 @@ if __name__ == '__main__': mainloop = GObject.MainLoop() + if options.uuid == "hfp": + options.channel = 7 + options.record = hfp_record + options.name = "HFP HandsFree" + opts = { "Name" : options.name, "AutoConnect" : options.auto_connect, @@ -88,6 +142,9 @@ if __name__ == '__main__': if (options.channel): opts["Channel"] = dbus.UInt16(options.channel) + if (options.record): + opts["ServiceRecord"] = options.record + manager.RegisterProfile(options.path, options.uuid, opts) mainloop.run() -- 2.47.3