diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-12-02 13:28:41 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-12-02 13:28:41 +0200 |
commit | 901a2c3041df13cbb439eaa719d55131b6cb24c6 (patch) | |
tree | c401e765eeb6862156d3148fc26c45eafdee13ac /test | |
parent | 4a073b1a5a3a4742a67485c71298944bb66cc50b (diff) |
Add speakergain, microphonegain, play and stop to test-telephony
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-telephony | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/test-telephony b/test/test-telephony index 76041b99..eb695117 100755 --- a/test/test-telephony +++ b/test/test-telephony @@ -24,6 +24,10 @@ if len(sys.argv) < 2: roaming <yes|no> registration <status> subscriber <number> + speakergain <bdaddr> [level] + microphonegain <bdaddr> [level] + play <bdaddr> + stop <bdaddr> """ % sys.argv[0] sys.exit(1) @@ -47,6 +51,58 @@ if sys.argv[1] == "disconnect": headset.Disconnect() sys.exit(0) +if sys.argv[1] == "speakergain": + if len(sys.argv) < 3: + print "Need device address parameter" + sys.exit(1) + device = adapter.FindDevice(sys.argv[2]) + headset = dbus.Interface(bus.get_object("org.bluez", device), + "org.bluez.Headset") + if len(sys.argv) > 3: + headset.SetProperty('SpeakerGain', dbus.UInt16(sys.argv[3])) + else: + props = headset.GetProperties() + print props['SpeakerGain'] + + sys.exit(0) + +if sys.argv[1] == "microphonegain": + if len(sys.argv) < 3: + print "Need device address parameter" + sys.exit(1) + device = adapter.FindDevice(sys.argv[2]) + headset = dbus.Interface(bus.get_object("org.bluez", device), + "org.bluez.Headset") + if len(sys.argv) > 3: + headset.SetProperty('MicrophoneGain', dbus.UInt16(sys.argv[3])) + else: + props = headset.GetProperties() + print props['MicrophoneGain'] + + sys.exit(0) + +if sys.argv[1] == "play": + if len(sys.argv) < 3: + print "Need device address parameter" + sys.exit(1) + device = adapter.FindDevice(sys.argv[2]) + headset = dbus.Interface(bus.get_object("org.bluez", device), + "org.bluez.Headset") + headset.Play() + + sys.exit(0) + +if sys.argv[1] == "stop": + if len(sys.argv) < 3: + print "Need device address parameter" + sys.exit(1) + device = adapter.FindDevice(sys.argv[2]) + headset = dbus.Interface(bus.get_object("org.bluez", device), + "org.bluez.Headset") + headset.Stop() + + sys.exit(0) + if sys.argv[1] == "outgoing": if len(sys.argv) > 2: test.OutgoingCall(sys.argv[2]) |