From 9162dfde2d6a7625849aa873fc5ef9220779e7a9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jun 2008 12:54:26 +0000 Subject: Move D-Bus config file and example clients back into hcid directory --- daemon/Makefile.am | 8 ---- daemon/bluetooth.conf | 33 -------------- daemon/test-database | 119 -------------------------------------------------- daemon/test-manager | 27 ------------ hcid/Makefile.am | 10 +++-- hcid/bluetooth.conf | 34 +++++++++++++++ hcid/simple-service | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ hcid/test-manager | 27 ++++++++++++ 8 files changed, 187 insertions(+), 190 deletions(-) delete mode 100644 daemon/bluetooth.conf delete mode 100755 daemon/test-database delete mode 100755 daemon/test-manager create mode 100644 hcid/bluetooth.conf create mode 100755 hcid/simple-service create mode 100755 hcid/test-manager diff --git a/daemon/Makefile.am b/daemon/Makefile.am index a3354221..02742923 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -1,10 +1,2 @@ -if CONFIGFILES -dbusdir = $(sysconfdir)/dbus-1/system.d - -dbus_DATA = bluetooth.conf -endif - -EXTRA_DIST = bluetooth.conf test-manager test-database - MAINTAINERCLEANFILES = Makefile.in diff --git a/daemon/bluetooth.conf b/daemon/bluetooth.conf deleted file mode 100644 index aa642a2a..00000000 --- a/daemon/bluetooth.conf +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/daemon/test-database b/daemon/test-database deleted file mode 100755 index 44a872a9..00000000 --- a/daemon/test-database +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/python - -import time -import dbus - -bus = dbus.SystemBus() - -xml = ' \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -' - -database = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), - 'org.bluez.Database') - -handle = database.AddServiceRecordFromXML(xml) - -print "Service record with handle 0x%04x added" % (handle) - -print "Press CTRL-C to remove service record" - -try: - time.sleep(1000) - print "Terminating session" -except: - pass - -database.RemoveServiceRecord(dbus.UInt32(handle)) diff --git a/daemon/test-manager b/daemon/test-manager deleted file mode 100755 index 759b6a48..00000000 --- a/daemon/test-manager +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -import gobject - -import dbus -import dbus.mainloop.glib - -def adapter_added(path): - print "Adapter with path %s added" % (path) - -def adapter_removed(path): - print "Adapter with path %s removed" % (path) - -if __name__ == "__main__": - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - bus = dbus.SystemBus() - - manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), - 'org.bluez.Manager') - - manager.connect_to_signal("AdapterAdded", adapter_added) - - manager.connect_to_signal("AdapterRemoved", adapter_removed) - - mainloop = gobject.MainLoop() - mainloop.run() diff --git a/hcid/Makefile.am b/hcid/Makefile.am index 9ecd1f97..4cba3e03 100644 --- a/hcid/Makefile.am +++ b/hcid/Makefile.am @@ -1,5 +1,9 @@ if CONFIGFILES +dbusdir = $(sysconfdir)/dbus-1/system.d + +dbus_DATA = bluetooth.conf + confdir = $(sysconfdir)/bluetooth conf_DATA = hcid.conf @@ -52,9 +56,9 @@ AM_YFLAGS = -d CLEANFILES = lexer.c parser.c parser.h -EXTRA_DIST = hcid.8 hcid.conf.5 hcid.conf dbus-api.txt \ - list-devices test-discovery test-adapter test-device simple-agent \ - service-record.dtd \ +EXTRA_DIST = bluetooth.conf hcid.8 hcid.conf.5 hcid.conf dbus-api.txt \ + list-devices test-discovery itest-manager test-adapter test-device \ + simple-service simple-agent service-record.dtd \ service-did.xml service-spp.xml service-opp.xml service-ftp.xml MAINTAINERCLEANFILES = Makefile.in diff --git a/hcid/bluetooth.conf b/hcid/bluetooth.conf new file mode 100644 index 00000000..e2f4e923 --- /dev/null +++ b/hcid/bluetooth.conf @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hcid/simple-service b/hcid/simple-service new file mode 100755 index 00000000..4c2bce4e --- /dev/null +++ b/hcid/simple-service @@ -0,0 +1,119 @@ +#!/usr/bin/python + +import time +import dbus + +bus = dbus.SystemBus() + +xml = ' \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +' + +adapter = dbus.Interface(bus.get_object('org.bluez', '/'), + 'org.bluez.Adapter') + +handle = adapter.AddServiceRecord(xml) + +print "Service record with handle 0x%04x added" % (handle) + +print "Press CTRL-C to remove service record" + +try: + time.sleep(1000) + print "Terminating session" +except: + pass + +adapter.RemoveServiceRecord(dbus.UInt32(handle)) diff --git a/hcid/test-manager b/hcid/test-manager new file mode 100755 index 00000000..759b6a48 --- /dev/null +++ b/hcid/test-manager @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import gobject + +import dbus +import dbus.mainloop.glib + +def adapter_added(path): + print "Adapter with path %s added" % (path) + +def adapter_removed(path): + print "Adapter with path %s removed" % (path) + +if __name__ == "__main__": + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + bus = dbus.SystemBus() + + manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), + 'org.bluez.Manager') + + manager.connect_to_signal("AdapterAdded", adapter_added) + + manager.connect_to_signal("AdapterRemoved", adapter_removed) + + mainloop = gobject.MainLoop() + mainloop.run() -- cgit