8 <?xml version="1.0" encoding="UTF-8" ?> \
10 <attribute id="0x0001"> \
12 <uuid value="0x1101"/> \
16 <attribute id="0x0002"> \
20 <attribute id="0x0003"> \
21 <uuid value="00001101-0000-1000-8000-00805f9b34fb"/> \
24 <attribute id="0x0004"> \
27 <uuid value="0x0100"/> \
30 <uuid value="0x0003"/> \
36 <attribute id="0x0005"> \
38 <uuid value="0x1002"/> \
42 <attribute id="0x0006"> \
44 <uint16 value="0x656e"/> \
45 <uint16 value="0x006a"/> \
46 <uint16 value="0x0100"/> \
50 <attribute id="0x0007"> \
54 <attribute id="0x0008"> \
55 <uint8 value="0xff"/> \
58 <attribute id="0x0009"> \
61 <uuid value="0x1101"/> \
62 <uint16 value="0x0100"/> \
67 <attribute id="0x000a"> \
68 <url value="http://www.bluez.org/"/> \
71 <attribute id="0x000b"> \
72 <url value="http://www.bluez.org/"/> \
75 <attribute id="0x000c"> \
76 <url value="http://www.bluez.org/"/> \
79 <attribute id="0x0100"> \
80 <text value="Serial Port"/> \
83 <attribute id="0x0101"> \
84 <text value="Serial Port Service"/> \
87 <attribute id="0x0102"> \
88 <text value="BlueZ"/> \
91 <attribute id="0x0200"> \
93 <uint16 value="0x0100"/> \
97 <attribute id="0x0201"> \
103 bus = dbus.SystemBus()
104 manager = dbus.Interface(bus.get_object("org.bluez", "/"),
107 if len(sys.argv) > 1:
108 path = manager.FindAdapter(sys.argv[1])
110 path = manager.DefaultAdapter()
112 service = dbus.Interface(bus.get_object("org.bluez", path),
115 handle = service.AddRecord(xml)
117 print "Service record with handle 0x%04x added" % (handle)
119 print "Press CTRL-C to remove service record"
123 print "Terminating session"
127 service.RemoveRecord(dbus.UInt32(handle))