OSDN Git Service

test: Add support for dynamic channels and PSMs to test-profile
authorJohan Hedberg <johan.hedberg@intel.com>
Sat, 17 Nov 2012 04:50:45 +0000 (06:50 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Sat, 17 Nov 2012 04:54:37 +0000 (06:54 +0200)
test/test-profile

index 0753e6f..3e38f95 100755 (executable)
@@ -65,9 +65,11 @@ if __name__ == '__main__':
                                        action="store_true",
                                        dest="auto_connect", default=False),
                        make_option("-P", "--PSM", action="store",
-                                       type="int", dest="psm"),
+                                       type="int", dest="psm",
+                                       default=None),
                        make_option("-C", "--channel", action="store",
-                                       type="int", dest="channel"),
+                                       type="int", dest="channel",
+                                       default=None),
                        make_option("-r", "--record", action="store",
                                        type="string", dest="record",
                                        default=None),
@@ -94,10 +96,10 @@ if __name__ == '__main__':
        if (options.role):
                opts["Role"] = options.role
 
-       if (options.psm):
+       if (options.psm is not None):
                opts["PSM"] = dbus.UInt16(options.psm)
 
-       if (options.channel):
+       if (options.channel is not None):
                opts["Channel"] = dbus.UInt16(options.channel)
 
        if (options.record):