3 from __future__ import absolute_import, print_function, unicode_literals
11 <?xml version="1.0" encoding="UTF-8" ?> \
13 <attribute id="0x0001"> \
15 <uuid value="0x1101"/> \
19 <attribute id="0x0002"> \
23 <attribute id="0x0003"> \
24 <uuid value="00001101-0000-1000-8000-00805f9b34fb"/> \
27 <attribute id="0x0004"> \
30 <uuid value="0x0100"/> \
33 <uuid value="0x0003"/> \
39 <attribute id="0x0005"> \
41 <uuid value="0x1002"/> \
45 <attribute id="0x0006"> \
47 <uint16 value="0x656e"/> \
48 <uint16 value="0x006a"/> \
49 <uint16 value="0x0100"/> \
53 <attribute id="0x0007"> \
57 <attribute id="0x0008"> \
58 <uint8 value="0xff"/> \
61 <attribute id="0x0009"> \
64 <uuid value="0x1101"/> \
65 <uint16 value="0x0100"/> \
70 <attribute id="0x000a"> \
71 <url value="http://www.bluez.org/"/> \
74 <attribute id="0x000b"> \
75 <url value="http://www.bluez.org/"/> \
78 <attribute id="0x000c"> \
79 <url value="http://www.bluez.org/"/> \
82 <attribute id="0x0100"> \
83 <text value="Serial Port"/> \
86 <attribute id="0x0101"> \
87 <text value="Serial Port Service"/> \
90 <attribute id="0x0102"> \
91 <text value="BlueZ"/> \
94 <attribute id="0x0200"> \
96 <uint16 value="0x0100"/> \
100 <attribute id="0x0201"> \
101 <uint32 value="0"/> \
106 bus = dbus.SystemBus()
108 if len(sys.argv) > 1:
109 path = bluezutils.find_adapter(sys.argv[1]).object_path
111 path = bluezutils.find_adapter().object_path
113 service = dbus.Interface(bus.get_object("org.bluez", path),
116 handle = service.AddRecord(xml)
118 print("Service record with handle 0x%04x added" % (handle))
120 print("Press CTRL-C to remove service record")
124 print("Terminating session")
128 service.RemoveRecord(dbus.UInt32(handle))