diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-03-15 02:22:33 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-03-15 02:22:33 +0000 |
commit | ea7a10e0084b203f1e414cb163a9b5a998d80a83 (patch) | |
tree | b3d2011503ab1039a6176501fa339832f9987485 /hcid | |
parent | 31e4b89ccb965ef5d955c8e99147f5f69f539899 (diff) |
Add command to test service record registration
Diffstat (limited to 'hcid')
-rwxr-xr-x | hcid/test-adapter | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hcid/test-adapter b/hcid/test-adapter index e7770c0f..a4612257 100755 --- a/hcid/test-adapter +++ b/hcid/test-adapter @@ -2,6 +2,7 @@ import sys import dbus +import time bus = dbus.SystemBus() @@ -19,6 +20,7 @@ if (len(sys.argv) < 2): print " requestmode <mode>" print " discoverabletimeout [timeout]" print " periodicdiscovery [on/off]" + print " addservicerecord <file>" sys.exit(1) if (sys.argv[1] == "address"): @@ -69,6 +71,19 @@ if (sys.argv[1] == "periodicdiscovery"): else: value = dbus.Boolean(sys.argv[2]) adapter.SetProperty("PeriodicDiscovery", value) + time.sleep(120) + sys.exit(0) + +if (sys.argv[1] == "addservicerecord"): + if (len(sys.argv) < 3): + print "Need file parameter" + else: + f = open(sys.argv[2]) + record = f.read() + f.close() + handle = adapter.AddServiceRecord(record) + print "0x%x" % (handle) + time.sleep(120) sys.exit(0) print "Unknown command" |