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 --- hcid/simple-service | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 hcid/simple-service (limited to 'hcid/simple-service') 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)) -- cgit