python - Starting bluez-simple-agent giving an Exception Error: Already Exists -
I am using blues-simple agents on Ubuntu and starting with a blues-simple agent I am here. After that I get an exception:
traceback (most recent call final): The file "/ usr / bin / bluez-simple-agent", line 133, & lt ; Module & gt; Adapter.RegisterAgent (path, capacity), file "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70 __call__ return (* args, ** keywords) file in the self._proxy_method "/ Usr / lib / python2.7 / dist-packages / dbus / proxies.py ", line 145, __call__ ** in the keyword)" /usr/lib/python2.7/dist-packages/dbus/connection.py " Line 651, message, timeout) dbus.exceptions.DBusException in call_blocking: org.bluez.Error.AlreadyExists: <: already
Bluez-Simple-Agent A codenippet exists> former if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop (set_as_default = true) bus = dbus.SystemBus () manager = dbus.Interface (bus.get_object ("org.bluez "" / ")," Org.bluez.Manager ") = "DisplayYesNo" parser = OptionParser () parser.add_option ("- c", "--capability", action = "store", type = "string", dest = "capability") (options, args) = parser. Paragraph_arug () if options.capability: capability = options.capability if LAN (args) & gt; 0: path = manager.FindAdapter (args [0]) and: path = manager Default adapter () adapter = dbus.Interface (bus.get_object ("org.bluez", path), "org.bluez.Adapter") path = "/ test / agent" agent = agent (bus, path) mainlop = gobject .manloup () if lane (rgs)> 1: If lane (RGS)> 2: Device = adapter.FindDevice (args [1]) adapter.RemoveDevice (Device) agent.set_exit_on_release (false) adapter.CreatePairedDevice (args [1], path, capacity, reply_handler = create_device_reply, error_handler = create_device_error) and: adapter.
How can I fix that problem?
Agent object with blues already exists and the creation of others will result in this error, If you are on Ubuntu, bluetooth-applelet (can find in PS) will be hit once, able to use simple agent through CMD prompts
Comments
Post a Comment